|
|
| Come for the quick hacks, stay for the epiphanies. | |
| PerlMonks |
How do I set a file's timestamp in perl?by faq_monk (Initiate) |
| on Oct 13, 1999 at 03:42 UTC ( [id://809]=perlfaq nodetype: print w/replies, xml ) | Need Help?? |
|
Current Perl documentation can be found at perldoc.perl.org. Here is our local, out-dated (pre-5.6) version:
You use the
if (@ARGV < 2) {
die "usage: cptimes timestamp_file other_files ...\n";
}
$timestamp = shift;
($atime, $mtime) = (stat($timestamp))[8,9];
utime $atime, $mtime, @ARGV;
Error checking is left as an exercise for the reader.
Note that
|
|