Spawning a process: Can I "have my cake and eat it too"?

Steven Schveighoffer schveiguy at yahoo.com
Fri Mar 2 14:42:34 UTC 2018


On 3/2/18 9:23 AM, Steven Schveighoffer wrote:
> On 3/1/18 11:50 PM, Nick Sabalausky (Abscissa) wrote:
>> How could this be accomplished? Is it even possible?
> 
> You'd have to do this in the parent. You can duplicate the file 
> descriptor, so that writing to either goes to the same spot, but you 
> can't "fork" the file descriptor, so that writing to one goes to 2 spots.

Hm.. you could potentially do this via an intermediary process that does 
the copying. Then you could avoid writing the buffering code in your 
parent or child.

i.e. something like the Unix tee command.

-Steve


More information about the Digitalmars-d-learn mailing list