delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/04/29/20:16:56

From: "Andrew Crabtree" <andrewc AT rosemail DOT rose DOT hp DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: RFI - Fork/Pipe pseudo code needed
Date: Wed, 29 Apr 1998 14:56:55 -0700
Organization: Hewlett-Packard, Roseville
Lines: 21
Message-ID: <6i87n6$7i0$1@rosenews.rose.hp.com>
NNTP-Posting-Host: ros51675cra.rose.hp.com
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Could somebody please give me some pointers or pseudo code to do the
following.

1) Suspend the current program and execute another one (they are both djgpp
programs if it makes a difference)
2) Capture stdout from the child program to a temporary file
3) Read in the temporary file from the parent after the child program has
finished.

I'm only familiar with the unix way of forking and piping, and am not quite
sure which functions (spawn?) I should be looking at and how to do the
redirection.  Presumably just close and dup2 or something but I'm not quite
sure.

cc's to my email appreciated

Thx in advance

Andy


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019