redirect _spawnl() to file
Posted on 1998-10-07
I'm using MSVC 1.52 to create a DOS app.
I'm trying to call a DOS program and redirect the output to a text file. For example, from a DOS command line:
C:\PROG.EXE PARM1 > C:\TEMPFILE.TMP
The code I'm using is:
_spawnl(_P_WAIT, "C:\\PROG.EXE","PARM1 > C:\\TEMPFILE.TMP", NULL)
No error is returned from _spawnl, but the file does not contain the contents of program output.
Is it possible to do this? or am I calling _spawnl incorrectly?