Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 7 Aug 1996 20:50:10 +0200 (SAT)
From:      Robert Nordier <rnordier@iafrica.com>
To:        dgy@rtd.com (Don Yuniskis)
Cc:        rnordier@iafrica.com, dgy@rtd.com, tcg@ime.net, fqueries@jraynard.demon.co.uk, questions@FreeBSD.ORG
Subject:   Re: perhaps i am just stupid.
Message-ID:  <199608071850.UAA00545@eac.iafrica.com>
In-Reply-To: <199608071553.IAA01784@seagull.rtd.com> from "Don Yuniskis" at Aug 7, 96 08:53:21 am

next in thread | previous in thread | raw e-mail | index | archive | help
Don Yuniskis wrote:

> > However there seems to be another underlying assumption: that MS-DOS
> > expands wildcards in alpha-sorted sequence.  It doesn't.  File
> > "bin.bz" (say) may just as well be processed before "bin.aa".  So
> > a "comp" without an intervening "sort" won't work.
> 
> Right.  DOS tends to serve things up in "directory order".  My assumption
> was that the files would have been ftp'ed in alpha order and, thus, present
> in the directory in that order!
> 
> > Another complication: DOS "sort" is little-used, broken, and may
> > not be in the PATH.
> 
> \DOS is usually in the PATH and SORT should be therein.

I agree that SORT usually will be available, and may be in c:\dos.
I'd be hesitant to actually _assume_ that in a utility, though.  For
instance, the system I'm using now has SORT in d:\windows\command
(as installed by Windows 95 setup).  On someone else's system, set up
for GNU C development, two incompatible implementations of SORT are in
d:\bin and c:\dos, and the non-DOS version has precedence in the PATH.

> How far back (e.g., DOS 1.0?) should we support this?  I would imagine
> 5.0 or 3.3 to be the "oldest" we'd need to support (??)  I'll try to
> dig up earlier versions to verify.

SORT goes way back on DOS.  However, older versions of DOS never had
an install routine, so files could (and frequently did) end up in
strange places.

Also the DOS sort is seriously brain dead (a better phrase than
"broken", which I used previously).  So the SORT in the path may not
belong to DOS, or respond to the same syntax.

> Another hack would be to use DIR to create a (sorted) file list
> but piping that into CKSUM would probably choke, too (since
> DOS is so brain dead).

You're right, this isn't a standard MS-DOS capability.

> I'd really like to avoid writing some DOS-specific utility to
> do this as it seems like bogus code to maintain.  I'd rather
> see *no* globbing and list everything explicitly...

On principle, I'd agree.  Though I'm not sure whether it would be
necessary to maintain the code at all.  MS-DOS still runs DOS 1.xx
binaries; and 'cksum' produces a standard 32-bit CRC which isn't
going to change anytime soon.  So maybe, in this particular case,
a DOS-specific utility would be more robust.

I actually have a DOS utility somewhere that does 32-bit CRCs and
even does limited ASCII-sequenced globbing (eg. "bin.[a-c]?").  It
was done for a company whose support people needed to check for
corrupt/incompatible binaries over the phone.  I suppose I could
dig it out and submit it, if no-one comes up with a preferred
solution.

-- 
Robert Nordier



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199608071850.UAA00545>