如何在Perl 6中检查文件时间戳属性?

问题描述 投票:2回答:1

在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 timestamp perl6 raku
1个回答
4
投票

[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
© www.soinside.com 2019 - 2024. All rights reserved.