Path: utzoo!attcan!uunet!mcsun!ukc!reading!cf-cm!cybaswan!iiitsh From: iiitsh@cybaswan.UUCP (Steve Hosgood) Newsgroups: comp.sys.ibm.pc Subject: Re: What interprets *.* Message-ID: <730@cybaswan.UUCP> Date: 22 Sep 89 20:26:55 GMT References: <32164@ames.arc.nasa.gov> <667@suntops.Tops.Sun.COM> <727@cybaswan.UUCP> Reply-To: iiitsh@cybaswan.UUCP (Steve Hosgood) Organization: Institute for Industrial Information Technology Lines: 44 In article <667@suntops.Tops.Sun.COM> rdas@hatter.tops.sun.com (Robin Das) writes: >In article <32164@ames.arc.nasa.gov> gahooten@titan (Gregory A. Hooten) writes: >>In Unix, it is the shell that interprets the character *, what in >>DOS will do the same thing? > >COMMAND.COM does the * and ? processing in DOS. Sorry - wrong! COMMAND.COM passes * and ? to the user program. Since the user- program then has to expand them, DOS supplies a pair of system-calls to let user-programs do it fairly easily. These are calls $4E (Find First) and $4F (Find Next). There is also an archaic pair, calls $11 (Find First) and $12 (Find Next) left over from the early days. These don't support full pathnames though. >... If you want a program to >do the same type of thing, the program must include the smarts. This is true enough. The reason is that a parent process can only pass 128 characters to a child on the command line. If COMMAND.COM expanded *.* as UNIX's shell does, then this 128 char barrier would regularly be hit. ******** ADVERT FOLLOWS: There is a TSR in comp.binaries.ibm.pc called 'WILDUNIX', which intercepts calls to DOS functions $4E and $4F, and causes them to treat wildcards in the UNIX manner. For instance "[a-j]*.exe" would be OK. This doesn't work unless the utility being run uses DOS to expand wildcards. Some of them 'do it by hand' so to speak. Also, some old programs call functions $11 and $12 instead, and they can't be intercepted either. However, if your program uses $4E and $4F cleanly, WILDUNIX will allow it to be driven a la UNIX. I've been running it on my machine for months and it works fine with all the UNIX-lookalike utilities I run. -----------------------------------------------+------------------------------ Steve Hosgood BSc, | Phone (+44) 792 295213 Image Processing and Systems Engineer, | Fax (+44) 792 295532 Institute for Industrial Information Techology,| Telex 48149 Innovation Centre, University of Wales, | JANET: iiitsh@uk.ac.swan.pyr Swansea SA2 8PP | UUCP: ..!ukc!cybaswan!iiitsh -----------------------------------------------+------------------------------ My views are not necessarily those of my employers! Please note the change in my username as of 1 Aug '89