home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-385-Vol-1of3.iso
/
c
/
cops_104.zip
/
cops_104
/
perl
/
file_mode.pl
< prev
next >
Wrap
Perl Script
|
1992-03-10
|
414b
|
24 lines
#
# This retrieves a possibly cached mode on file.
# If it returns "BOGUS", it means that the stat failed.
#
# tchrist@convex.com
package main;
require 'stat.pl';
package file_mode;
sub main'Mode {
local($file) = @_;
if (!defined $modes{$file}) {
if (&'Stat($file)) {
$modes{$file} = $'st_mode;
} else {
$modes{$file} = 'BOGUS';
}
}
$modes{$file};
}