bug-coreutils
[Top][All Lists]
Advanced

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

bug#9531: md5sum: confusing documentation for file type output


From: Eric Blake
Subject: bug#9531: md5sum: confusing documentation for file type output
Date: Sat, 17 Sep 2011 07:18:02 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.20) Gecko/20110831 Fedora/3.1.12-2.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.12

On 09/17/2011 07:10 AM, Rüdiger Meier wrote:
On Saturday 17 September 2011, Reuben Thomas wrote:
Secondly, looking at the code, this isn't really what md5sum does.
Rather, it prints '*' if in binary mode (--binary, or if O_BINARY is
non-zero), and ' ' if in text mode (--text, or if O_BINARY is zero),

BTW I was always confused about the --binary thing.
If you're going to update man pages anyway it would be nice to point out
that --binary makes a difference only if O_BINARY exists on the target
system (which is usually not the case for most users I guess).

I hate the way md5sum currently works. What we _should_ have done is make binary normal, and do a new symbol for O_TEXT being non-zero. That way, the only platforms where it matters (such as cygwin) would default to binary, and make it explicit when carriage returns were not being considered due to text mode differing from binary mode.

Also, presence of a literal carriage return in a file name must be escaped as \r (just as we escape \n and \\ for newlines and unambiguous escapes), so that md5sum output on a platform with text files does not cause ambiguities when literal carriage returns are eaten or added.

I've had ideas of how to change things for several years now, but never enough of an itch to actually code it up. The biggest problem is the fact that it would be an incompatible format to what existing md5sum parses, so you'd have to phase it out with options on whether to generate new or old style.

--
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org





reply via email to

[Prev in Thread] Current Thread [Next in Thread]