Here's a little idea for you. If you are just checking modified times and not actual content, you can simple do something like:

  1. Do a File::Find on the old directory structure
  2. Store the information in a hash with the filenames(with full paths) as keys and the modified date/time as the value.
  3. Once you finish, do a File::Find on the new directory structure
  4. Compare the modify date/times of the new files with what you have stored for the old files

I don't know how many files you are talking about? Thousands? Millions? Don't underestimate Perl's speed, if all you are checking is modify times then your bottleneck will be the Disk I/O not your script. And that would be the case with other solutions as well. If you are concerned about time and efficiency, you can separate the two loops above and have the resulting hash from the File::Find on the old directory structure stored using the Storable module. That way you can cache the mod times of the files before you need to compare them to the new directory structure and then just retrieve them when you run the script against the new directory.

HTH


In reply to Re: Directory comparison by pzbagel
in thread Directory comparison by maxl90

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.