delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1992/10/13/14:43:45

From: Eric Backus <ericb AT lsid DOT hp DOT com>
Subject: Re: ls (of filutl32)
To: turnbull AT ecolan DOT sbs DOT ohio-state DOT edu
Date: Tue, 13 Oct 92 11:19:06 PDT
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu (djgpp)
Mailer: Elm [revision: 66.25]

> If I remember correctly, "." and ".." are not entries in an MS-DOS
> directory.  MS-DOS finds them by special casing them.  Inconsistently
> enough, the special case considers them to be alphabetical.  That's
> MS-DOS; not much you can do about it ;-)
>     I don't know about GO32 or COMMAND.COM, but under 4DOS "*" is
> equivalent to "*.*"; to get the behavior you describe you need "*.".
> 4DOS also accepts the "*test.c" syntax.

4DOS has improved upon generic MS-DOS.  Generic MS-DOS does not make
"*" equivalent to "*.*".

> In csh, "~" is an abbreviation for $HOME.  Since MS-DOS doesn't know
> about it, it sounds like either "ls" or "MS_SH200" is globbing "*~",
> and for some reason when it doesn't find anything else, tries "~" as a
> special case and gets $HOME or maybe ".".  I don't think that
> low-level MS-DOS functions do any globbing; that's all done by the
> user program.  Most libraries have slightly higher-level functions
> which do some globbing, but the entries to DOS via INT 21 insist that
> only single character wildcards ("?") are permitted.
> --
> Stephen Turnbull    The Ohio State University    Department of Economics
>       410 Arps Hall, 1945 N. High St., Columbus, OH 43210-1172 USA 
>   Phone: (614) 292-0654    Fax: ...-3906    Email: turnbull DOT 1 AT osu DOT edu

I am quite sure that MS_SH200 is not expanding "*~", because I have
written a simple program that prints out the arguments that were
passed to it, and "*~" gets passed unaltered.  There is no $HOME
expansion involved.  In fact, if you do

main()
{
	struct stat buf;
	stat("*~", &buf);
}

You will find that the stat() succeeds, although there isn't really a
"*~" file.  The buf variable will hold information on ".", the current
directory.  I believe that MS-DOS is treating this as a single "*"
wildcard (since MS-DOS always ignores characters after "*") and
somehow is expanding that to ".".  I could be wrong though.
--
				Eric Backus
				ericb%hplsla AT hplabs DOT hp DOT com
				(206) 335-2495

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019