in reply to efficient way to find most recently modified files?

Whatever filesystem you are on, storing 500,000+ files in a single directory is a really bad idea if you are regularly going to need access to some small subset of those files from short runtime scripts (eg. cgi scripts).

Given that you have a nice regular format for the filenames, it would be much better to seggregate the files into smaller subsets by using some part of that filename as a directory name. Example: You might use

.\bobby\bobby2006-05-08.txt
or
.\2006\05\08\bobby2006-05-08.txt

Which of these schemes make most sense for your application will depend upon the details of the usage patterns, but the basic idea is to allow you to reduce the search space by going directly to some subset of files quickly.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.