Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

stat

Returns file metadata as a 13-element list.

Returns a 13-element list giving the status info for a file. The elements are: dev, ino, mode, nlink, uid, gid, rdev, size, atime, mtime, ctime, blksize, blocks. Follows symbolic links (use lstat to stat the link itself). Returns an empty list on failure.

When Time::HiRes::stat has been imported into the caller’s namespace, the atime/mtime/ctime fields are returned as floating-point seconds with nanosecond precision.

Synopsis

my @s = stat($file);
my ($dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size,
    $atime, $mtime, $ctime, $blksize, $blocks) = stat($file);
stat $fh;                  # stat on a filehandle
stat _;                    # reuse last stat buffer

See Also

lstat, chmod, chown