Greetings, esteemed monks!

I need to make sure that two directory trees are identical in terms of structure, but in name only (ie, list of filenames is identical, but the files in "mirrored" dir will be variations on the theme of the files in the "master" directory).

Is this just a simple File::Find thing with two calls to find() where I would push each $File::Find::name value onto the corresonding array, and then a simple equality test at the end?

At first all I care about is just getting notified if the mirror is off. Then I'd like to build up to outputting a list of the differences, then to actually fixing the differences (rsync-style).

There's a twist though; there is one subdirectory in the "master" tree that we will likely NOT want mirrored over. I imagine I could take care of that with a conditional in the &wanted sub, but what do you think? Maybe add it as an argument to the program in case the list of non-mirrored dirs grows? I don't know how likely that is.

Let me know if code/pseudocode would help, and if the general premise isn't as clear as I intended.

Terrence

_________________________________________________________________________________

I like computer programming because it's like Legos for the mind.


In reply to How to ensure duplicate directory and file tree, but not file contents themselves? by OfficeLinebacker

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.