Subject: md5sum uses text mode, not binary mode
From: [email-masked] (Michael R Cook)

19 Jun 1998 01:50:44 -0700
Message-ID: <[email-masked]>
To: [email-masked]

The md5sum program seems to be reading it's files in text mode
instead of binary mode.  That seems to make md5sum mostly useless.

Here's what makes me think md5sum is using text mode.

First, md5sum calculates the same signature regardless of whether it
reads from stdin or whether it opens the file itself:

	$ md5sum foo.exe
	d4bb47940abe12e88cbf5286f3f0664b  foo.exe
	$ md5sum < foo.exe
	d4bb47940abe12e88cbf5286f3f0664b  -

Next, md5sum calculates the same signature even if its input came
from `cat'.

	$ cat foo.exe | md5sum
	d4bb47940abe12e88cbf5286f3f0664b  -

Finally, `cat' obviously uses text mode:

	$ cat foo.exe | wc
	     11      48    2098
	$ ls -l foo.exe
	-r-xr-xr-x   1 544      everyone  1190912 Jun 17 16:15 foo.exe
	$

Clearly, `cat' read only the first 2098 bytes.  I infer that it saw
a ^Z and stopped, implying that `cat' reads its files in text mode.

Michael.
-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".