www.delorie.com/djgpp/v2faq/faq128.html | search |
| Previous | Next | Up | Top |
Q: I call my program with an argument x*y and it complains about something called xyzzy??...
Q: I cannot find a way to use the /? switch with my programs!
main
function is called. Unlike other DOS-based compilers, where you must link your
program with a special object module if you want the program to get expanded filenames, in DJGPP this is considered normal behavior and performed by default on behalf of every DJGPP program. The
x*y above was expanded to a file called xyzzy which was probably present in the current working directory; and /? is by default expanded to the list of
one-letter files/directories you happen to have in the root directory of the current drive. (If you don't want the default expansion, see how to disable globbing.)
In DJGPP, filename globbing works like in Unix, which is more general than the usual DOS wildcard expansion. It understands the following constructs with special meta-characters:
Note that *.* only picks up files that actually have an extension. This is contrary to the usual DOS practice where it means all the files, with or without extension.
An argument which cannot be expanded (no filenames matching that particular pattern) will be passed to the program verbatim. This is different from what you might see under Unix, where some shells (like csh) would say something like "No match" and won't call your program at all. DJGPP's behavior in this case is like shells of the Bourne legacy (sh, ksh, and bash).
If the wildcards include upper-case or mixed upper- and lower-case letters, the letter-case of the files is not ignored on Windows 9X when expanding the wildcards. For example, [A-D]*
will not match a file called aFileName. Upper-case letters in wildcards also disable automatic down-casing of short 8+3 file names returned by the code that expand
wildcards (even on plain DOS). If the wildcards include only lower-case letters, the letter-case is ignored during expansion, and short 8+3 file names are automatically down-cased, unless the
environment variable FNCASE
is set to y. The effect of setting FNCASE
is fully described in the DJGPP C Library reference, under the
_preserve_fncase
function; type info libc alpha _preserve_fncase from the DOS prompt.
webmaster donations bookstore | delorie software privacy |
Copyright ⌐ 1998 by Eli Zaretskii | Updated Sep 1998 |
You can help support this site by visiting the advertisers that sponsor it! (only once each, though)