Mail Archives: djgpp/1999/09/15/21:58:04
"NG Chi Fai, John" wrote:
>
> Hello all,
>
> I have a program that take command line parameters.
>
> int main(int argc, char * argv) { }
>
> When I put ".\somedir\*.*" as the parameter, argc is not 2, but can be
> anything, say, 3 if I have 3 files in the "somedir", and the parameters
> will be:
>
> .\somedir\file1.sth
> .\somedir\file2.sth
> .\somedir\file3.sth
>
> I think it is a little bit weird.
>
> I'm using DJGPP with EGCS.
>
> Please advise how anything I can do such that I only receive 1
> paramenter ".\somedir\*.*"
>
> Thanks in advance.
>
> NG Chi Fai
Quote it. i.e. run the program like
foo ".\somedir\*.*"
This is a feature; it's so Unix ports can do things like "rm *" even
without a Unixy shell installed.
You can also disable globbing (that's what this expansion is called) by
defining a function like
char **__crt0_glob_function (char *arg) { return 0; }
in your source.
--
Nate Eldredge
neldredge AT hmc DOT edu
- Raw text -