Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

That is how can I know some files in the directory have been updated.(I do not know what is in the directory) thank you
  • Comment on How can I know whether a certain directory's size is changed?

Replies are listed 'Best First'.
Re: How can I know whether a certain directory's size is changed?
by chromatic (Archbishop) on Feb 29, 2000 at 21:06 UTC
    See perldoc -f -X. What you want is the -s test. -s FILEHANDLE will return the (nonzero) size of the file referred to by FILEHANDLE. That won't help you if you're on a Unix machine, though. (On my box here, the directory size is 1024 -- that's a feature of the particular filesystem.) You might also look at the modification time test (-M FILEHANDLE). It returns the age of the file when the script started.