Please consider looking at this node of mine from a few months ago (and at the thread that it's part of, too). The original question there was similar to yours, I think: someone wanted to be able to check a directory tree at regular intervals to locate all the paths and files that had been added since the preceding check.

One of the points made there was that using the GNU "find" command with backticks or system() was a lot faster than File::Find on big file spaces covering many thousands of files.

Another point was that, if you're doing this sort of checking at intervals, save listings of files (and mod times, if necessary) in each directory; then the next time you check, use "-newer list.file" to locate files more recent than the listing created during the last check.


In reply to Re: Get newest file by graff
in thread Get newest file by Spida

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.