Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Wednesday February 04, 2004
04:02 PM

Comparing directories

[ #17212 ]

Maintaining my modules while I am here is a pain in the ass, which is why I am so glad that Andy does most of it.

I cannot setup SSH on these public computers, so I am effectively locked out of using CVS from them. So, I tar my directory on my Powerbook, carry it via SneakerNet to the public computers, upload it to a unix account, untar it, then cvs update it. Usually I find conflicts because I cannot update it as often as I would like.

The other day Andy updated a lot of stuff, so I got a fresh working copy and did the previous process in reverse, thinking I would just compare the files in the fresh copy with the files in my local copy.

I could have written a shell script to traverse the two directories to make the comparisons, or I could have written a Perl script. But, I had the bright idea of checking diff(1) to see if it would do it, and, at lest on Mac OS X, it does.

% diff -r dir1 dir2

That compares every file, but some of the files, sya, pm_to_blib, do not matter, so I can skip some files.

% diff -X dir1/MANIFEST.SKIP -r dir1 dir2

Isn't that nifty?

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.