Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hey everyone, I have a question about File::stat, in particular - mode. I am in the process of writing a script that checks the permissions of certain files and I would like to use File::stat->mode, but the output just doesn't seem to make sense -- I am writing this on an AIX machine v 4.3.3 Here's the code
$inetmode = stat("/etc/inetd.conf"); print $inetmode->mode & 0777;
The output is 420, I was expecting 644 any suggestions?? TIA, Brett

Replies are listed 'Best First'.
Re: File::stat question
by merlyn (Sage) on Feb 13, 2002 at 20:09 UTC
      Thanks that worked great, but.... I am almost embarrassed to ask this.....how do I write that value to a variable ... I am sure that this is very obvious but not to the newbie. TIA, Brett