public function file_permissions($file)
    {
        // fileperms returns a numeric value
        $numeric_perms = fileperms($file);
        // but we are used to seeing the octal value
        $octal_perms = sprintf('%o', $numeric_perms);
        return substr($octal_perms, -4);
    }