Path: utzoo!utgpu!water!watmath!clyde!rutgers!gatech!mcnc!decvax!decwrl!pyramid!prls!philabs!pwa-b!mmintl!franka From: franka@mmintl.UUCP (Frank Adams) Newsgroups: comp.lang.c Subject: Re: Wildcard expansion in Turbo C Keywords: glob, Turbo C Message-ID: <2785@mmintl.UUCP> Date: 25 Mar 88 15:56:46 GMT References: <1282@nmtsun.nmt.edu> <329@gen1.UUCP> <977@mcgill-vision.UUCP> Reply-To: franka@mmintl.UUCP (Frank Adams) Organization: Ashton-Tate Corporation, East Hartford Development Center Lines: 32 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". For those of us who are accustomed to thinking of a file as a file name and a file type, it is Un*x which does not behave "sensibly". (And of the half dozen or so systems I have used, all but Un*x take this approach.) Note that if you want all your C files on MS-DOS, "*.c" works just fine. I don't think I have ever done a search where I wanted to match all and only file names ending in "c". On the other hand, with the name/extension paradigm, I can search for "*." and find all the files with no extension. No comparable Un*x search is possible. (With full regular expression searching, it is *possible*, but not worth it.) This should not be taken as a flame against Un*x -- simple file names permitting embedded "."s do have their advantages. Nor should it be taken as indicating that I consider MS-DOS a real operating system. All I'm saying is, try using the system as it was intended to be used, instead of as a brain-damaged version of something else. There are few design decisions so bad that one cannot make some sort of productive use of them. -- Frank Adams ihnp4!philabs!pwa-b!mmintl!franka Ashton-Tate 52 Oakland Ave North E. Hartford, CT 06108