On Wed, 25 Sep 2013 17:01:06 +0200 Irek Szczesniak wrote:
> On Wed, Sep 25, 2013 at 2:49 PM, Glenn Fowler <g...@research.att.com> wrote:
> >
> > this is just a general comment on those contemplating adding
> > #ifdef to select option visibility based on the underlying system

> Is this about md5sum(1)? AFAIK the *defaults* are platform-specific,
> based on what Windows does, but not the availability of the options.
> Or is this something different?

md5sum triggered the comment
but there are / have been other patches in the queue that do similar this
libcmd::sync(1) and ksh93::cd(1) -@ come to mind
I wanted to nip it in the bud so it doesn't become a habit

now re md5sum

the gnu docs are fouled up because they don't match gnu-ish reality on cygwin
cygwin actually gets it right by making --binary the default
but that leads to
        gnu-md5sum *.tgz > gnu-output
run on linux and cygwin, for the same set of files, producing different results
the md5sum (should) match but the cygwin output will have the '*' indicator

suppose, for the same set of *.tgz you do this on cygwin
        gnu-md5sum *.tgz > cygwin-output
and this on linux
        gnu-md5sum *.tgz > linux-output
on cygwin this will fail
        gnu-md5sum --check linux-output
at least on linux this will work
        gnu-md5sum --check cygwin-output

the *ast* --binary default is not platform specific because it is consistent
across unix and _WINIX and honors the principle of least surprise
so this
        ast-md5sum *.tgz > ast-output
and this
        ast-md5sum --check ast-output
will work no matter what platform either command is executed on

the next alpha, probably later today to fix the ASTAPI() build problem, will
have libcmd::cksum(1) and libsum fixed to generate and consume the ' ' and '*'
read mode indicators -- the only thing will be that on all systems by default
ast md5sum will print the '*' indicator -- lets see how many gnu-reliant scripts
blow up due to that -- this is one of those things that if you demand gnu
semantics on one side prepare to handle them on the other

the good thing about this approach is that ast-md5sum generated output
will be compatible with gnu-md5sum --check no matter what platform either
ast-md5sum or gnu-md5sum are run on
*and*
ast-md5sum will also handle gnu-md5sum output with the proviso that if the
intention on the gnu side was to sum binary files then they better well have
used --binary to do it or it will fail up on _WINIX -- but in reality no
gnu user will do that because the docs say it doesn't really matter -- in
this case there aren't enough ast patches to fix gnu

_______________________________________________
ast-developers mailing list
ast-developers@lists.research.att.com
http://lists.research.att.com/mailman/listinfo/ast-developers

Reply via email to