in reply to RE: RE: RE: RE: Answer: How do I get all the permission flags on a file?
in thread How do I get all the permission flags on a file?

sub return_mode { my $mode = shift; my @modelist = (($mode & 7000)>>9, ($mode & 0700)>>6, ($mode & 007 +0)>>3, ($mode &0007)); return join('', @modelist); } print return_mode (07777), "\n";
prints 5777 on my machine. Nuff said. Your code has 7000 where it needs 07000.

-- Randal L. Schwartz, Perl hacker

  • Comment on RE: RE: RE: RE: RE: Answer: How do I get all the permission flags on a file?
  • Download Code