On Mon, May 18, 2009 at 11:35:56AM -0300, Casimiro de Almeida Barreto wrote:
Any suggestions on how reopen stdOut to a desired point other than the default?
Hi Casimiro,
I was looking into this just last night, and have gotten far enough so that the following works, and I can verify that the Unix file descriptors are properly duplicated for child processes to inherit correctly.
OSProcess command: 'mkfifo myPipe'. fd := FileStream fileNamed: 'myPipe'. OSProcess thisOSProcess redirectStdOutTo: fd. OSProcess thisOSProcess redirectStdErrTo: fd. OSProcess thisOSProcess stdOut nextPutAll: 'hello '; flush. OSProcess thisOSProcess stdErr nextPutAll: 'world!'; flush. fd next: 11 ==> 'hello world'
This requires some updates to OSProcessPlugin (a primitive for the dup2() system call) and to OSProcess. I'm not done yet, but I'll try to get this cleaned up and posted by this weekend.
Dave