Greg Lopp on 21 Apr 2006 23:55:45 -0000


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Perl question


from my Camel book....
-M Age of file (at startup) in days since modification
-A Age of file (at startup) in days since last access
-C Age of file (at startup) in days since inode change

?!! in days?   That's probably no help.

Hmmmm.

To get seconds, looks like you need to use the stat() function....File::stat will make it even easier


Eric wrote:
In the shell I can easily compare the dates of two files:

$  if [ .y2log -nt .y2log-1 ]; then
     echo .y2log is newer than .ylog-1
   else
     echo .y2log is older than .ylog-1
   fi
.y2log is newer than .ylog-1
$

So what is the similar perl idiom for comparing file dates?

I have to compare 166,000 (+) pairs of files and I'd rather
do it with perl.  Particularly since I open the directory
and read the filenames into a hash which turns out to be
wicked-fast for processing the file names.

Thanks,

Eric


___________________________________________________________________________ Philadelphia Linux Users Group -- http://www.phillylinux.org Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce General Discussion -- http://lists.phillylinux.org/mailman/listinfo/plug