vertigo wrote:
I have file acces mode as number for example: 755,
and i want to change it to text for example: -rwx------
Is there any module/function for that ?
1) Post to comp.lang.perl.misc instead of this comp.lang.perl newsgroup.
2) Look at 'find2perl' for hints.
unix% find2perl . -ls >temp.pl
my @rwx = qw(--- --x -w- -wx r-- r-x rw- rwx);
my $perms = $rwx[$mode & 7];
$mode >>= 3;
$perms = $rwx[$mode & 7] . $perms;
$mode >>= 3;
$perms = $rwx[$mode & 7] . $perms;
substr($perms, 2, 1) =~ tr/-x/Ss/ if -u _;
substr($perms, 5, 1) =~ tr/-x/Ss/ if -g _;
substr($perms, 8, 1) =~ tr/-x/Tt/ if -k _;