I am writing one script which will compare file modification time and current time and if both has more than 24 hours diff, then print some message somthing like this file is older than 24 hours. I have written following script bt stuck on d way..any help?
my $file = "rajesh.txt"; my $file_timestamp = stat($file)->mtime; my $timestamp = localtime($epoch_timestamp); my $startTime = time(); my $rajesh = $nowEpoc - $file_timestamp; print "The current time is = $startTime\n"; print "The file modified time is = $file_timestamp\n"; print "The difference between file modified time and current time is = + $rajesh\n";
In reply to compare file modification time and current time by rajeshatbuzz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |