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.
In reply to Re: File permission converter
by chipmunk
in thread File permission converter
by Centaurus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |