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_owner.pl
< prev
next >
Wrap
Perl Script
|
1992-03-10
|
398b
|
22 lines
#
# This retrieves possibly cached owner of a file.
# If it returns "BOGUS", it means that the stat failed.
package main;
require 'stat.pl';
package file_owner;
sub main'Owner {
local($file) = @_;
if (!defined $owners{$file}) {
if (&'Stat($file)) {
$owners{$file} = $'st_uid;
} else {
$owners{$file} = 'BOGUS';
}
}
$owners{$file};
}