Date: Sun, 21 Jun 1998 14:29:44 +0300 (IDT) From: Eli Zaretskii To: Ruiter de M cc: djgpp AT delorie DOT com Subject: Re: Bug in DJGPP port of diff? In-Reply-To: <6mdqnj$s18$1@star.cs.vu.nl> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On 19 Jun 1998, Ruiter de M wrote: > bash$ diff -q file1 file2 > Files file1 and file2 differ > bash$ diff -s file1 file2 > Files file1 and file2 are identical > > Especially the last lines are very entertaining: identical files > differ! I could understand both answers, but not both at once. You can hardly blame `diff' for the brain-damage of Microsoft-style text vs. binary files hassles. What `diff' tries very hard to do is to provide useful results and leave you (and me) sane in all possible cases, and still report accurate output. If you find that amusing, then so be it ;-). More to the point, by default, `diff' reads the files in text mode unless it detects binary characters (which in this case aren't there), so these two files are read as text and compare equal. But -q implies binary reads, so the files compare different when you use -q (`cmp' would say that also). > Is this a bug or have I missed some documentation? You have missed a prolonged description of the ``binary files'' issue in the `diff' manual. Look it up by typing this from the DOS prompt: info diff Comparison Binary