Wildcard expansion in Turbo C
Frank Adams
franka at mmintl.UUCP
Sat Mar 26 01:56:46 AEST 1988
In article <977 at mcgill-vision.UUCP> mouse at mcgill-vision.UUCP (der Mouse) writes:
>In article <329 at gen1.UUCP>, bob at gen1.UUCP (Robert Kamins) writes:
>> In <1282 at nmtsun.nmt.edu>, greg at 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
More information about the Comp.lang.c
mailing list