Path: utzoo!mnetor!uunet!husc6!bloom-beacon!mcgill-vision!mouse From: mouse@mcgill-vision.UUCP (der Mouse) Newsgroups: comp.lang.c Subject: Re: Wildcard expansion in Turbo C Message-ID: <1038@mcgill-vision.UUCP> Date: 9 Apr 88 23:31:20 GMT References: <1282@nmtsun.nmt.edu> <329@gen1.UUCP> <977@mcgill-vision.UUCP> <2785@mmintl.UUCP> Organization: McGill University, Montreal Lines: 29 Keywords: glob, Turbo C In article <2785@mmintl.UUCP>, franka@mmintl.UUCP (Frank Adams) writes: > In article <977@mcgill-vision.UUCP> mouse@mcgill-vision.UUCP (der Mouse) writes: >> In article <329@gen1.UUCP>, bob@gen1.UUCP (Robert Kamins) writes: >>> In <1282@nmtsun.nmt.edu>, greg@nmtsun.nmt.edu (Greg Lindhorst) writes: >>> 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. > Please don't confuse "what I'm used to" with "sensible". [points out > that some think of filesnames as "name" + "type"] I wasn't making that mistake. Personally, I prefer the UNIX way, but I recognize that it is reasonable to treat names as split up in this way. However, suppose your directory contains A.C B.C FOOA.C FOOB.C BARA.C BARB.C and you glob *B.C. The sensible thing, which VMS and presumably most systems with name+type filenames do, is to produce B.C FOOB.C BARB.C. MS-DOS gives you all six .C files. In fact, any pattern whose name portion (the part before the dot) begins with a * behaves as if there were nothing else in the name portion, I can tell. *This* you surely do not consider sensible. der Mouse uucp: mouse@mcgill-vision.uucp arpa: mouse@larry.mcrcim.mcgill.edu