in reply to File permission converter
This gets the mode directly, and then uses printf to print it as an octal number.$mode = (stat($filename))[2]; printf "Permissions are %04o\n", $mode & 07777;
Update: This example is from perl5.005_03's documentation. The documentation on PerlMonks is from 5.005_02.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: File permission converter
by Centaurus (Novice) on Feb 15, 2001 at 04:47 UTC |