Leser: 17
1 2 3 4 5 6 7 8
foreach (glob("*.cgi")) { my $mode = (stat($_))[2]; $mode = sprintf '%04o', $mode & 07777; if($mode >= 0755) { $mode = "<span style=\"color:green;\">$mode</span>"; } else { $mode = "<span style=\"color:red;\">$mode</span>"; } print $_." - ".$mode."\n"; }
1 2 3 4 5 6 7 8
$mode = (stat($file) )[2] & 07777; if ( $mode >= 0755 ) { # permission of $file is ok } else { # permission is not ok }
2010-02-08T15:50:08 LinuxerFilemode-Kontrolle korrigiert: s/<=/>=/
Guest Pep[...]
So richtig funktioniert es nicht.
[...]