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

Re: compare two directory trees



In <[🔎] AANLkTi=mj9Tsyk=OohqAbp8bat96k6FM5ZfBGyTG_8Cc@mail.gmail.com>, Yuwen Dai 
wrote:
>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?

Don't waste CPU time on MD5.  Don't waste CPU time performing filesystem 
operations.  Compare the two images byte-by-byte using something like diff.

What takes the most time though is the I/O.  You could use statistical 
techniques to reduce the amount of I/O you perform at the cost of some 
accuracy.  However, you are probably better off reducing I/O time by getting 
faster drives, particularly the optical drive.
-- 
Boyd Stephen Smith Jr.                   ,= ,-_-. =.
bss@iguanasuicide.net                   ((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy         `-'(. .)`-'
http://iguanasuicide.net/                    \_/

Attachment: signature.asc
Description: This is a digitally signed message part.


Reply to: