Re: piping processes

2011-12-01 Thread Regan Heath
On Wed, 30 Nov 2011 23:35:58 -, NMS nathanms...@gmail.com wrote: Is there a cross-platform way to create a new process and get its i/o streams? Like java.lang.Process? No. It different on windows and unix platforms, tho most/many of the unix platforms are similar. std.process is

Re: piping processes

2011-12-01 Thread Dejan Lekic
NMS wrote: Is there a cross-platform way to create a new process and get its i/o streams? Like java.lang.Process? I doubt. However, you can use platform-specific popen() (POSIX) and _popen() (Windows) for that. I recently talked about this on IRC. At the moment Phobos uses system() ,

Re: piping processes

2011-12-01 Thread Andrej Mitrovic
I can't find my thread in the archives yet, but I made a similar inquiry a few days ago. You can see a few examples for Windows here: https://github.com/AndrejMitrovic/DWinProgramming/tree/master/Samples/Extra/RedirectChildHandle

Re: piping processes

2011-12-01 Thread Dejan Lekic
We talked about that too on IRC - the conclusion was - we should have std.pipe module with (at least) AnonymousPipe, and NamedPipe classes.

Re: piping processes

2011-12-01 Thread Regan Heath
On Thu, 01 Dec 2011 11:28:50 -, Dejan Lekic dejan.le...@gmail.com wrote: We talked about that too on IRC - the conclusion was - we should have std.pipe module with (at least) AnonymousPipe, and NamedPipe classes. Definitely. I will have a hunt for my misplaced code but it had some sort

Re: piping processes

2011-12-01 Thread Regan Heath
On Thu, 01 Dec 2011 11:29:52 -, Andrej Mitrovic andrej.mitrov...@gmail.com wrote: I can't find my thread in the archives yet, but I made a similar inquiry a few days ago. You can see a few examples for Windows here:

Re: piping processes

2011-12-01 Thread Andrej Mitrovic
On 12/1/11, Regan Heath re...@netmail.co.nz wrote: I know these are basic examples, but I think in RedirectChildHandle.d, CreateChildProcess, you should (ideally) be closing childStdoutWrite and childStdinRead /after/ CreateProcess. If you don't you get 2 copies of them, one in the child and

Re: piping processes

2011-12-01 Thread Andrej Mitrovic
On 12/1/11, Regan Heath re...@netmail.co.nz wrote: you should (ideally) be closing childStdoutWrite and childStdinRead /after/ CreateProcess. If you don't you get 2 copies of them, one in the child and one in the parent. Ok so I should move CloseHandle(childStdoutWrite) immediately after a

Re: piping processes

2011-12-01 Thread Steven Schveighoffer
On Thu, 01 Dec 2011 06:10:00 -0500, Regan Heath re...@netmail.co.nz wrote: On Wed, 30 Nov 2011 23:35:58 -, NMS nathanms...@gmail.com wrote: Is there a cross-platform way to create a new process and get its i/o streams? Like java.lang.Process? No. It different on windows and unix

Re: piping processes

2011-12-01 Thread Steven Schveighoffer
On Thu, 01 Dec 2011 08:24:25 -0500, Steven Schveighoffer schvei...@yahoo.com wrote: On Thu, 01 Dec 2011 06:10:00 -0500, Regan Heath re...@netmail.co.nz wrote: std.process is rather limited in it's current incarnation but I think Steve is working on a bit update.. It's ready for review,

piping processes

2011-11-30 Thread NMS
Is there a cross-platform way to create a new process and get its i/o streams? Like java.lang.Process?