I am trying to create a script which gathers the stat info of every file in
a given directory. Then return the date it was last modified for the purpose
of picking the file that was created/modiefied last. The script is reading
the files ok, however, when placing them in the stat() to exctact the info,
it only reads the . and .. files correctly, while returning the same date
for all of the text files. The incorrect date I get for them is:
Last modified at:Wed Dec 31 18:00:00 1968
@ARGV=$dir;
$directory=shift || '.';
opendir DIR, $directory || die "Can't open directory $directory:
$!\n";
while ($file=readdir DIR)
{
#print "$file\n";
@filespecs=stat("$file");
$last_modification_time = localtime($filespecs[9]);
print "Last modified at:$last_modification_time\n";
#print "$mytime\n";
}
How do I get it to read the date it was last created/modified?
Thanks!
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]