This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
pipes and spawn
- To: <gnu-win32 at cygnus dot com>
- Subject: pipes and spawn
- From: Craig Setera <setera at us dot ibm dot com>
- Date: Fri, 29 May 1998 09:13:10 -0400
I'm trying to use the spawn family of calls to kick off a child process and then
have them communicate through pipes, but that does not seem to work. For
instance (from memory... maybe not perfect):
int in[1], out[2];
int pid;
char *args[3];
pipe(in);
pipe(out);
args[0] = (char *) malloc (50);
strcpy(args[0], "/some/program/name");
args[1] = (char *) malloc (10);
sprintf(args[1], "%d", in[1]);
args[2] = (char *) malloc (10);
sprintf(args[2], "%d", out[0]);
pid = spawnv(P_NOWAIT, args[0], args);
This does not seem to work correctly and I'm not sure why. It is as if the
pipe is
not open or something. Can anyone offer any insights or samples?
Thanks,
Craig
Craig Setera
AS/400 Enterprise Java Development
IBM Rochester
setera@us.ibm.com
(507) 253-3387 - Tie: 553-3387
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".