Ouch, this is weird and inexplicable.
Somehow diff identifies differences in two identical binary files. In the following example two duplicate files are located (i) in my home directory (/m/home/user) and (ii) at the root of a different drive (D:).
But this is just an example. The spurious differences are identified for all binary files. (As I found when comparing two identical trees, containing many binaries, using diff -rqs.)
First, confirm they are identical. Notice the 5 different ways I may use to identify the file in my home directory. Using md5sum confirms they are identical (so does cmp -bl, say).
~> md5sum INTERVAL.pdf /d/INTERVAL.pdf 5f6ac8c4882f4804805ff41291a665bf *INTERVAL.pdf 5f6ac8c4882f4804805ff41291a665bf */d/INTERVAL.pdf ~> md5sum ./INTERVAL.pdf /d/INTERVAL.pdf 5f6ac8c4882f4804805ff41291a665bf *./INTERVAL.pdf 5f6ac8c4882f4804805ff41291a665bf */d/INTERVAL.pdf ~> md5sum ~/INTERVAL.pdf /d/INTERVAL.pdf 5f6ac8c4882f4804805ff41291a665bf */home/user/INTERVAL.pdf 5f6ac8c4882f4804805ff41291a665bf */d/INTERVAL.pdf ~> md5sum /home/user/INTERVAL.pdf /d/INTERVAL.pdf 5f6ac8c4882f4804805ff41291a665bf */home/user/INTERVAL.pdf 5f6ac8c4882f4804805ff41291a665bf */d/INTERVAL.pdf ~> md5sum /m/home/user/INTERVAL.pdf /d/INTERVAL.pdf 5f6ac8c4882f4804805ff41291a665bf */m/home/user/INTERVAL.pdf 5f6ac8c4882f4804805ff41291a665bf */d/INTERVAL.pdfNow test for differences in the files (there are none, of course). Only the 5th of the 5 different ways by which I may identify the file in my home directory demonstrates that the two files are the same. Otherwise they are reported as being different.
~> diff -s INTERVAL.pdf /d/INTERVAL.pdf Files INTERVAL.pdf and /d/INTERVAL.pdf differ ~> diff -s ./INTERVAL.pdf /d/INTERVAL.pdf Files ./INTERVAL.pdf and /d/INTERVAL.pdf differ ~> diff -s ~/INTERVAL.pdf /d/INTERVAL.pdf Files /home/user/INTERVAL.pdf and /d/INTERVAL.pdf differ ~> diff -s /home/user/INTERVAL.pdf /d/INTERVAL.pdf Files /home/user/INTERVAL.pdf and /d/INTERVAL.pdf differ ~> diff -s /m/home/user/INTERVAL.pdf /d/INTERVAL.pdf Files /m/home/user/INTERVAL.pdf and /d/INTERVAL.pdf are identicalUsing XP Pro SP3. This happens with the current cygwin1.dll and the snapshot dated 20100822.
Attached, cygcheck.out. Fergus
cygcheck.out.bz2
Description: Binary data
-- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple