I've done this type of thing before by using File::Find along with Digest::MD5 and stat() to recursively walk through a directory and create a "file status" file for both directories. The file status files can be sorted by filename, then "diff"-ed to show differences between the two directory trees. The format of the file status file looked something like this: (pipe-delimited).
dir1/path/to/file1|MD5checksum_of_file_content|last_modified_time|perm
+s|...
dir1/path/to/file2|MD5checksum_of_file_content|last_modified_time|perm
+s|...
...
To get started easily, you can run 'find2perl dir1' to build the code for you, then edit the contents of
sub wanted to print the various attributes that you want compared.
If you need to do directory synchronization, you may also find unison to be useful.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.