[clug] PHP fileperms()
jamie at jre.id.au
Wed Jan 30 07:46:35 UTC 2019
I steered you slightly wrong there Bryan. Apologies. Time for me to leave
work I think.
It's not the lower four bits we're interested in, but rather the first four
from the sprinf to octal.
On Wed, Jan 30, 2019 at 6:43 PM Jamie Reid <jamie at jre.id.au> wrote:
> Hi Bryan,
> From the documentation: "Returns the file's permissions as a numeric
> Lower bits of this mode are the same as the permissions expected by
> however on most platforms the return value will also include information
> on the
> type of file given as filename."
> It's probably going to be most useful to you to format the lower four bits
> this output into an octal representation -- something that looks like 0755.
> An example from the documentation shows how to do this:
> echo substr(sprintf('%o', fileperms('/tmp')), -4);
> There are likely more efficient/others ways to achieve the same lower in
> the page
> but the above seems the easiest to understand.
> : http://php.net/manual/en/function.fileperms.php
> On Wed, Jan 30, 2019 at 6:21 PM Bryan Kilgallin via linux <
> linux at lists.samba.org> wrote:
>> I used this to check two test files: txt and php. The result in both
>> cases was "33188". What does this number mean, in terms of file
>> linux mailing list
>> linux at lists.samba.org
More information about the linux