[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: compare two directory trees



On 14.12.2010 10:15, Yuwen Dai wrote:
> Dear all,
> 
> I burn DVD/CDs from ISO files.  In order to verify the burning is correct,  I
> wrote a script working like this:
> 1. mount the DVD and ISO files onto two mount points
> 2. calculate every file's md5sum in each directory, and save and sort them in
> two separate files
> 3. compare the above two files.
> 
> The above method does work, but too time consuming because of the md5sum
> calculating.  Do you have any suggestion to improve the efficiency?
> 
> Best regards,
> Yuwen

Hi, my guess is that there is none (or a faster hash algorithm) unless you use
a programs that first detects different file sizes and calculates the hash
only if the file names and size match. Of course, this does not speed up
things if the data on both trees are equal. I personally use fdupes for this
purpose.

But in your case I'd calculate the hash from the ISO image file and the DVD
device so there's no overhead from travelling the directory tree(s).

-- 
Juha Tuuna


Reply to: