neilwatson has asked for the wisdom of the Perl Monks concerning the following question:
In this example the target file is /etc/passwd. Here are my results.($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size, $atime,$mtime,$ctime,$blksize,$blocks) = stat($file); ... Later $mode = $mode & 07777; print "mode=".$mode."\n";
Why is the mode 420 rather than 644?$ ls -l /etc/passwd -rw-r--r--. 1 root root 1289 Jul 22 16:27 /etc/passwd $ ./perms-module.pl /etc/passwd 644 root root mode=420
Neil Watson
watson-wilson.ca
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: state and file perms confusion
by Kenosis (Priest) on Aug 04, 2012 at 01:20 UTC | |
by neilwatson (Priest) on Aug 04, 2012 at 01:51 UTC | |
by Kenosis (Priest) on Aug 04, 2012 at 02:18 UTC | |
by Tanktalus (Canon) on Aug 04, 2012 at 13:55 UTC |