stat 的名字接口

时间:2024-09-05 22:35:20

File::stat - stat 的名字接口

名字为:dev, ino, mode, nlink, uid, gid, rdev, size, atime, mtime, ctime, blksize, and blocks.

语法:

 use File::stat;
$st = stat($file) or die "No $file: $!";
if ( ($st->mode & ) && $st->nlink > ) ) {
print "$file is executable with lotsa links\n";
} if ( -x $st ) {
print "$file is executable\n";
} use Fcntl "S_IRUSR";
if ( $st->cando(S_IRUSR, ) ) {
print "My effective uid can read $file\n";
} use File::stat qw(:FIELDS);
stat($file) or die "No $file: $!";
if ( ($st_mode & ) && ($st_nlink > ) ) {
print "$file is executable with lotsa links\n";