Telemachus <telemac...@arpinum.org> writes: > On Mon Jul 06 2009 @ 3:31, Harry Putnam wrote: >> Thanks to all ... >> Now I'm curious about something else: >> >> Is the mode in a stat(file) readout something still different >> than octal or decimal? > > As John answered, there's more there than just the permissions. If you > check perldoc -f stat, there's a recipe for how to get what most people > usually want out of that field: > > Because the mode contains both the file type and its > permissions, you should mask off the file type portion and > (s)printf using a "%o" if you want to see the real permissions. > > $mode = (stat($filename))[2]; > printf "Permissions are %04o\n", $mode & 07777; > > Hope this helps, T
Yes, thanks... not sure I understand it that well but it does what I wanted. Seems things are ALWAYS way more complicated than I expect them to be... -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/