in reply to open2() in Windows

Could you show us some reasonably short piece of code that reproduces the problem? Also, it would help to know what the program being called is doing, in particular the specifics of how it's handling reads and writes to the pipe. Smooth bidirectional communication depends as much on the behaviour of the process at the other end of the pipe, as it does depend on the side calling the open2.

For example, it could be some deadlock situation arising due to different buffer sizes involved, different timings, etc. (I.e. both sides are waiting for the other side to make the next step — which means that, without external intervention, they'd remain in that unfortunate state forever...). However, that's just a shot in the dark... I don't think there's any glaringly obvious explanation for why things are no longer working, so more details might help to generate other hypotheses.

Replies are listed 'Best First'.
Re^2: open2() in Windows
by bhaveshbp (Initiate) on Jul 23, 2007 at 04:46 UTC
    I cant really post any code because its work related and cant show any code. But ill try and recreate what happens abstractly.
    open2(read,write,program); for (executes about 6000 times) { print write $cmd; #This works fine and dandy until about usually 3500 iter +ations into the loop, and its the same command everytime. Sometimes +I even get to 5000 iterations into the loop before the program hangs. }
    Whats weird is if I open up the program manually and execute the commands that my script does by hand everything works fine. This is why I thought it was some kind of Windows buffer error.