[ale] System in Perl
Christopher Fowler
cfowler at outpostsentinel.com
Thu Jul 26 23:58:49 EDT 2007
Looks to me like you are trying to dimply display the last access time
of a file. I'm not sure what the problem of opening a file is but you
could actually use what you did.
Example:
[cfowler at shuttle ~]$ perl -MPOSIX -e '$a = (stat("/etc/inittab"))[8];
print POSIX::ctime($a);'
Wed Jul 11 17:54:16 2007
In my example stat() will return an epoch and you'll need to convert
that to a readable date.
my $access = `stat /etc/inittab | grep -i access | grep -v Uid | cut
-b8-27`;
More information about the Ale
mailing list