Wildcard expansion in Turbo C

Robert Kamins bob at gen1.UUCP
Fri Feb 12 06:25:08 AEST 1988


In <1282 at nmtsun.nmt.edu>, greg at nmtsun.nmt.edu (Greg Lindhorst) writes:

> I have a stupid question to ask.  How can one get Turbo C to expand
> wild carded arguments on the command line?
> 
> I.E. Translate something like: "doitto *.c"
>      into something like:      "doitto first_file.c second_file.c ..."

     The process of which you speak is called "globbing" and is normally
handled in Unix 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".  What you WILL get is
"abc.", "xyz." and in fact anything without an extension.

     Oh well, my glob is posted to "comp.binaries.ibm.pc" if you want it.
You can "#include" it or compile it and add the object to your libraries.

     Bob Kamins.



More information about the Comp.lang.c mailing list