Path: utzoo!mnetor!uunet!husc6!ncar!gatech!mcnc!decvax!decwrl!pyramid!prls!philabs!micomvax!zap!iros1!mcgill-vision!mouse From: mouse@mcgill-vision.UUCP (der Mouse) Newsgroups: comp.lang.c Subject: Re: Wildcard expansion in Turbo C Message-ID: <977@mcgill-vision.UUCP> Date: 7 Mar 88 07:18:11 GMT References: <1282@nmtsun.nmt.edu> <329@gen1.UUCP> Organization: McGill University, Montreal Lines: 38 Keywords: glob, Turbo C In article <329@gen1.UUCP>, bob@gen1.UUCP (Robert Kamins) writes: > In <1282@nmtsun.nmt.edu>, greg@nmtsun.nmt.edu (Greg Lindhorst) writes: >> How can one get Turbo C to expand wild carded arguments on the >> command line? > [In UNIX, this is done by the shell.] In MS-DOS-land, you get to do > it all by yourself. > I have a "glob" routine that does an MS-DOS wild-card expansion. The > trouble with MS-DOS expansion is that you can't easily glob stuff > like "*c" and expect to get files with names like "ab.c". Yes. And ugh. One weekend when I had MS-DOS inflicted on me, I started to write a glob routine that behaved sensibly. (It just told DOS to expand "*.*" in the appropriate directory and then filtered out what it wanted on its own.) It's not finished, but if enough people are desperate enough to want it, I can probably dig out and post the part that is finished. There is nothing inherently difficult about this; my main problem was that the machine I was on had no editor I would consider civilized. I was also using Microsoft's C compiler, that being what was available. (Not my machine; I would never be happy on anything that small.) The version I was using (I think it was version 4.something, for what that's worth) would bugcheck fairly easily, for example on the program main() { ((unsigned char far (*)[2])0xb0000000)[(0)+(80*(0))][0] = 0; } Yes, that mess resulted from a macro expansion, and yes, I was trying to write to screen memory. When either of the two (0) terms is replaced by a variable such as (i) or (j), the bugcheck disappeared. der Mouse uucp: mouse@mcgill-vision.uucp arpa: mouse@larry.mcrcim.mcgill.edu