Hello group:

In attempting to set $file2 to the same mode as $file1 I do this:

  my $mode = (stat($file1))[2];
  chmod $mode, $file2;

That code does the trick but I just want to make sure of:

1)
I see in perldoc -f chmod it talks about oct() but if I'm using stat's mode it should be safe not to use oct() correct?


2) $mode is really strange, ls -l shows a file as being 644 but $mode is 33188 or a directory as 755 but $mode is 16877

Why is that? What am I missing?

TIA

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to