A
Alexandre Jaquet
Hi,
I need to get the files dates on my script. I've found on the web the
following piece of code and explanation :
The -M file check returns the age in days since the file was last
changed. It includes fractional amounts, so if you want to compare days,
you need to take the ‘int’ of the returned value. The -A file check
returns the age in days since someone last looked at the file.
foreach $FileName (@ARGV) {
$FileAge = -M $FileName;
if ($FileAge < .5) {
print "\”$FileName\" is less than half a day old.\n";
} elsif ($FileAge < 1.5) {
print "\"$FileName\" is only a day old.\n";
} else {
$FileAge = int($FileAge+.5);
print "\"$FileName\" is $FileAge days old.\n";
}
}
but I didn't understand what exactly is returned by -M I want to get
"Tue Apr 12 10:11:23"
thanks in advance
Alexandre Jaquet
I need to get the files dates on my script. I've found on the web the
following piece of code and explanation :
The -M file check returns the age in days since the file was last
changed. It includes fractional amounts, so if you want to compare days,
you need to take the ‘int’ of the returned value. The -A file check
returns the age in days since someone last looked at the file.
foreach $FileName (@ARGV) {
$FileAge = -M $FileName;
if ($FileAge < .5) {
print "\”$FileName\" is less than half a day old.\n";
} elsif ($FileAge < 1.5) {
print "\"$FileName\" is only a day old.\n";
} else {
$FileAge = int($FileAge+.5);
print "\"$FileName\" is $FileAge days old.\n";
}
}
but I didn't understand what exactly is returned by -M I want to get
"Tue Apr 12 10:11:23"
thanks in advance
Alexandre Jaquet