coreutils
[Top][All Lists]
Advanced

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

Re: RFE: hash-type in sum utils


From: Pádraig Brady
Subject: Re: RFE: hash-type in sum utils
Date: Wed, 25 Jul 2012 22:24:59 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:6.0) Gecko/20110816 Thunderbird/6.0

On 07/25/2012 02:23 PM, Ondrej Oprala wrote:
> How should the '--tag' switch treat binary files? Should it create something 
> like this:
> MD5 (*filename) = ........   ?

Good question.
I wouldn't tag the filenamem because to be unambiguous you'd
have to have a space before the filename in text (default) mode,
and that would impact the current support for BSD format checksums.

I'd be inclined to tag just before the checksum like:

MD5 (filename) = binary_checksum (default for files on dos)
 MD5 (filename) = text_checksum  (default for files elsewhere)

I.E. in binary mode just use BSD format,
and add the extra space when generating text format.
This has the advantage of being mostly backwards compatible.
I.E. the existing GNU *sum utils accept a space before "MD5",
and so newer GNU `*sum --tag` output would be --check able on older
and other checksum utils.  The only backwards compat edge case
is with `*sum --tag --text` on dos, which would only be
compat with the newer versions of the GNU *sum tools.
But that's fine IMHO.

Another thing to consider if generating BSD format output,
is file name escaping.
Perhaps we want to follow BSDs rules here too,
which seems to use just use \ and ^ within the (filename brackets).
Doing that would allow use to be fully compat with their checksums and
also avoid the awkward backslash at start of line mode GNU currently uses,
which is not compatible with BSD format processing.

cheers,
Pádraig.



reply via email to

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