Mail Archives: djgpp/1994/10/05/00:18:43
Hi all,
Well, I guess the subject line pretty much covers it -- has anyone
been able to get the spawn*() or exec*() functions to work while
running within DV/X?
In particular, I'm trying to spawn off a batch file, and get control
back either immediately (e.g., spawn off a simultaneous process), or
when it's done. It really doesn't matter much which scenario is
achieved, just as long as we get a batch file to execute, and close
its window when it's done.
The code I'm using right now is as follows:
----------------------------------------------------------------------
FILE *out;
unlink("junk.dat");
out = fopen("runme.bat","w");
if( out==NULL ) {
fprintf(stderr,"ERROR: Can't open runme.bat\n");
exit(1);
}
fprintf(out,"dir > junk.dat\n");
fprintf(out,"echo >> junk.dat Done!\n");
fclose(out);
spawnlp(P_WAIT,"","c:\\idanstuf\\runme.bat","",0);
----------------------------------------------------------------------
Thanks!
-- Idan
- Raw text -