home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 11 Util
/
11-Util.zip
/
pipdos11.zip
/
_pd.c
next >
Wrap
Text File
|
1995-07-05
|
680b
|
27 lines
/* PipeDOSD: Run a dos command/program and redirect the output */
/* to a pipe specified in argp[1]. */
#include <process.h>
#include <stdio.h>
#include <string.h>
#include <io.h>
#include <fcntl.h>
#include <sys\stat.h>
int main(int argc, char **argp)
{
int result;
FILE *f;
if (argc < 2) {
printf("This program is meant to be called by PipeDOS.exe in an OS/2 session.\n");
exit(1);
}
freopen("/pipe/pipedos.0","r",stdin);
freopen("/pipe/pipedos.1","w",stdout);
freopen("/pipe/pipedos.2","w",stderr);
result = spawnvp(P_WAIT,argp[1], &argp[1]);
fclose(stdout);
fclose(stderr);
return result;
}