Jan 8, 2013, 7:48 AM
Post #3 of 3
Thanks for the reply, I realized my newbie mistake and fixed it.
Re: [FishMonger] Help with setting unix file timestamp in perl
[In reply to]
my $file = "/var/tmp/testtime";
my $now = time();
my $before1 = $now - (30*60); # 15 minutes ago
#my $before2 = $now - (3*60*60); # 3 hours ago
#my $before3 = $now - (2*24*60*60); # 2 days ago
open my $fh, '>', $file
or die "Can't create /tmp/file: $!\n";
utime($before1, $before1, $file);
I am using the dummy file's time stamp to test against for another script.