From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1044c2,fb87ccfc9e8baf0a X-Google-Attributes: gid1044c2,public X-Google-Thread: 1103af,fb87ccfc9e8baf0a X-Google-Attributes: gid1103af,public X-Google-Thread: f66ab,fb87ccfc9e8baf0a X-Google-Attributes: gidf66ab,public X-Google-Thread: f71eb,fb87ccfc9e8baf0a X-Google-Attributes: gidf71eb,public X-Google-Thread: f678f,fb87ccfc9e8baf0a X-Google-Attributes: gidf678f,public X-Google-ArrivalTime: 1995-01-09 10:18:50 PST Path: nntp.gmd.de!borneo!veit From: veit@borneo.gmd.de (Holger Veit) Newsgroups: comp.os.linux.misc,comp.os.os2.misc,comp.unix.osf.misc,comp.os.msdos.misc,comp.os.mach Subject: Re: The big Question Date: 9 Jan 1995 18:18:49 GMT Organization: GMD - German National Research Center for Computer Science Distribution: world Message-ID: <3erum9$7dl@omega.gmd.de> References: <3dpmo9$6fh@calvin.st-and.ac.uk> <3dupdf$7i4@hpscit.sc.hp.com> <3dvd4u$rmv@usenet.INS.CWRU.Edu> <1995Jan2.135536.27035@imec.be> <1995Jan4.051639.24693@prpa.philips.com> <3ei3o8$n8r@portal.gmu.edu> NNTP-Posting-Host: mururoa.gmd.de Xref: nntp.gmd.de comp.os.linux.misc:37772 comp.os.os2.misc:125875 comp.unix.osf.misc:2289 comp.os.msdos.misc:28576 comp.os.mach:3471 In article <3ei3o8$n8r@portal.gmu.edu>, scoile@osf1.gmu.edu (Steve "Stevers!" Coile) writes: |> Ross Morley (ross@prpa.philips.com) wrote: |> [...] |> >Oh, that reminds me. Wildcards. DOS screws them up too. DOS *doesn't* |> >do wildcards, each individual application program has to process them, |> >hence you get inconsistencies in the way "*" and "?" are handled in |> >difference command lines. In UNIX, the command interpreter (shell) |> >handles the wildcards so the apps don't have to worry about them and |> >you get consistency. |> |> I've never had a problem with inconsitancies with the handling of |> DOS wildcards. |> |> The advantage in not expanding wildcards is that the length of the |> command line buffer is not a factor in what will be passed to the |> program. You also don't have to worry about the maximum size of |> argv. You also don't have to worry that an opportunely named file |> may alter the behavior of your command. Normally you wouldn't see a command line buffer at all, and if so, a real operating system would have allocated it and passed it to the process. The DOS way is quite close to the old CP/M way of having 126 bytes of command line at 0x0080. It is the merit of C library implementations of the c0.obj startup code that the command line gets split into the argc/argv arguments. As argc is an int, I don't worry whether the value of it is 20 or 20000, as my program would not look different if it has to process 20 files or 20000 in sequence. Argv, BTW, is usually allocated on the stack, so it may be as long as stack size permits (with 16 bit dumb DOS, it could have been 64K in theory before awfully f*cking around with segments), but allocating a static buffer was obviously much more simple for the DOS developers, and not providing reasonable OS or library support for wildcard expansion (or one even does not dare to think about it, in the command line interpreter *) has caused the mix of programs that expand their arguments, don't do that, want to have their options in a non-intuitive sequence (like 'copy/b foo bar' won't do, but 'copy foo bar/b' will - or vice versa, don't nail me down on this, I use trial and error there), programs that mix command line arguments and direct input via gets - just the heterogeneous style a 1st semester student uses to write the first program. In earlier versions of DOS, there was an undocumented (yet another topic: Microsoft made undocumented features a real science - something you don't find in Unix (you probably won't find the right man page right now)) feature named switchar, allowing to toggle the option symbol from '/' to '-' (as God(tm) meant it to be ;-)) This feature got lost in some later hack (4.01, I think); must have been about the time the last Xenix programmer lost the company and the decay towards Windows began. -- Dr. Holger Veit | INTERNET: Holger.Veit@gmd.de | | / GMD-SET German National Research | Phone: (+49) 2241 14 2448 |__| / Center for Information Technology | Fax: (+49) 2241 14 2342 | | / Schloss Birlinghoven | Pentium - the first real | |/ 53754 St. Augustin, Germany | processor featuring the new | *** RISK technology ***