File::stat
Native Rust implementation built into the interpreter. Runtime: PP. See original documentation for the full Perl reference.
Provides by-name interface to Perl’s stat() builtin. Returns blessed objects with accessor methods for stat fields.
Functions
dev, ino, mode, nlink, uid, gid, rdev, size, atime, mtime, ctime, blksize, blocks
Accessor methods on the blessed File::stat object. Each returns the
corresponding field from stat(2), indexed into the underlying array.
use File::stat;
my $st = stat($filename);
my $uid = $st->uid;
my $mtime = $st->mtime;
lstat
Like stat, but does not follow symlinks (uses symlink_metadata).
use File::stat;
my $st = lstat('/path/to/symlink');
print $st->mode, "\n";
stat
Returns a blessed File::stat object (arrayref) for a path or filehandle.
Follows symlinks.
use File::stat;
my $st = stat('/etc/passwd');
print $st->size, "\n";