Stoomy has asked for the wisdom of the Perl Monks concerning the following question:
This gives me the values I'm looking for:#!/usr/bin/perl -w $file="/tmp/test.file"; $mode = (stat($file))[2]; printf "Permissions are %04o\n", $mode & 07777;
but I don't understand the "printf" function. I've read the perldoc, but I just don't get it. Also, I don't *think* I want it for the script on which I'm working.Permissions are 0744
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: stat and permissions
by toolic (Bishop) on Jan 14, 2011 at 23:45 UTC | |
by Stoomy (Novice) on Jan 17, 2011 at 19:47 UTC | |
|
Re: stat and permissions
by eff_i_g (Curate) on Jan 14, 2011 at 23:41 UTC | |
|
Re: stat and permissions
by jwkrahn (Abbot) on Jan 15, 2011 at 06:20 UTC | |
|
Re: stat and permissions
by cdarke (Prior) on Jan 15, 2011 at 15:35 UTC |