[perl]代码库
#-----------------------------
( $READTIME, $WRITETIME ) = ( stat ( $filename ) ) [8,9];
utime ( $NEWREADTIME, $NEWWRITETIME, $filename );
#-----------------------------
$SECONDS_PER_DAY = 60 * 60 * 24;
( $atime, $mtime ) = ( stat ( $file ) ) [8,9];
$atime -= 7 * $SECONDS_PER_DAY;
$mtime -= 7 * $SECONDS_PER_DAY;
utime ( $atime, $mtime, $file )
or die "couldn't backdate $file by a week w/ utime: $!";
#-----------------------------
$mtime = ( stat $file ) [9];
utime ( time, $mtime, $file );
#-----------------------------
use File::stat;
utime ( time, stat ( $file )->mtime, $file );
#-----------------------------
# download the following standalone program
#!/usr/bin/perl -w
# uvi - vi a file without changing its access times
$file = shift or die "usage: uvi filename\n";
( $atime, $mtime ) = ( stat ( $file ) ) [8,9];
system ( $ENV {EDITOR} || "vi", $file );
utime ( $atime, $mtime, $file )
or die "couldn't restore $file to orig times: $!";
#-----------------------------