Re: [Dev-C++] Automatic wildcard expansion
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Mac R. <re...@no...> - 2002-07-14 14:18:40
|
At least in theory, you can get the users of your program to work around the issue by running either makedict e d:\code\makedict\dict.txt \*.txt (not recommended) or makedict e d:\code\makedict\dict.txt "*.txt" (better) The first option escapes just the * wildcard, and the second option encloses the entire argument away from the expansion engine. Since DOS/Windows uses \ as a directory separator, I doubt that MinGW can properly detect it as an escape character. The quotes are an easier option to explain, since they will be needed for long filenames that contain spaces. The preceding advice is untested, and is based on the assumption that if MinGW is trying to mimic UNIX behavior, it should also mimic the appropriate protection mechanisms. Mac At 10:34 AM 7/13/02 +0200, Luigi Santillo wrote: >At 14.39 07/12/02 +0530, "Abhijit Shylanath" <mu...@gm...> wrote: >>If I run >> makedict e d:\code\makedict\dict.txt *.txt >>my program receives it as >> >>-Start-------------------------- >>arg 0: makedict >>arg 1: e >>arg 2: d:\code\makedict\dict.txt >>arg 3: dict.txt >>-Stop--------------------------- >> >>I recall that this behaviour is a GCC feature, and I can bypass it by >>quoting the argument, but how can I explicitly tell the compiler to disable >>such expansion? > >It is a feature of MinGW (because command.com does not deal with wildcards) >which, I guess, can't be disabled for consistency with the Unix (where the >shell expands wildcards and you prevent that by escaping special characters). > >-- >Luigi - _____________________________ /"\ Mac Reiter \ / ASCII Ribbon Campaign Nomadics, Inc. X Against HTML Mail re...@no... / \ (To join the campaign, simply use this in your signature.) |