在Perl 5中,您可以使用stat
来获取文件的访问,修改和更改的时间戳。
例如:
stat
将导致:
my $filename = "sample.txt";
my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
$atime,$mtime,$ctime,$blksize,$blocks)
= stat($filename)
print "File '$filename' was last accessed $atime seconds since the epoch.\n";
您如何在Perl 6中检查文件时间戳?
[Perl 6中的File 'sample.txt' was last accessed 1431707004 seconds since the epoch.
是file test operators from Perl 5中的方法(例如.modified
,.accessed
和.changed
)。
例如:
IO::FileTestable
role
就我而言,给:
IO::FileTestable