Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

test report (Announce)

posted by Rugxulo Homepage, Usono, 14.05.2008, 00:39

> > So how exactly do you get OpenWatcom to expand wildcards (a la DJGPP
> > globbing) into separate members in argv[]? wildargv.c? (Last I tried,
> it
> > didn't work for me, but I probably did it incorrectly.)
>
> That's a good question. There's a file WILDARGV.OBJ, which must be
> specified in the link step to replace the standard argv handling. I didn't
> try it yet, but JWasm could also benefit from this knowledge.

Whew, a really easy answer, luckily! (I was used to Turbo C and CC386 only needing WILDARGV.C by itself, hence the many errors when trying to compile without INITARG.H being found). You need both %WATCOM%\SRC\STARTUP\wildargv.c and initarg.h (I just copied 'em to the current dir). Then, you'll see it works:

// TEST.C
#include <stdio.h>

int main( int argc, char* argv[] )
{
  int i;

  if (argc > 1) for (i=1; i < argc; i++) printf("%s,",argv[i]);

  return 0;
}


wcl386 -q test
test *.zip (prints "*.zip,")

... or ...

wcl386 -q test wildargv
test *.zip (prints a list of .ZIPs in the current dir)

P.S. You can get WILDARGV.C and INITARG.H in MISC_SRC.ZIP (109k) if you don't already have it. However, it's packed in Deflate64, so use Info-Zip's UNZIP (or p7zip, 7za + HX, etc) if necessary.

 

Complete thread:

Back to the forum
Board view  Mix view
22632 Postings in 2109 Threads, 402 registered users, 425 users online (0 registered, 425 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum