in reply to Re: Can't get it working: Bidirectional Pipe on Windows
in thread Can't get it working: Bidirectional Pipe on Windows

Thanks for your comment. I also think that it has to do with buffering, and in this case I have zero knowledge about the properties of the other process, except what I already said.

I also thought first that somehow EOF won't be recognized, so I explicitly sent a "Windows Textfile EOF" (Control-Z), but - as I already had expected - this had no effect. I think I will follow the solution suggested by BrowserUK. To be honest, I had hoped that I would find a solution which will then work on Unix too (although this is not required), but it seems that Windows and Unix are too different in this respect...

-- 
Ronald Fischer <ynnor@mm.st>

Replies are listed 'Best First'.
Re^3: Can't get it working: Bidirectional Pipe on Windows
by Marshall (Canon) on Mar 09, 2012 at 15:14 UTC
    I would re-consider this idea of not making a temporary file for the input. This simplifies the situation a lot. And prevents deadlocks that can occur in a single process while simultaneously feeding stuff in and reading stuff out.

    The File::Temp module is multi-platform and generates a unique file name that you can use. The best is to delete this file yourself when you are finished with it, although this file will be created in a directory that is periodically cleaned-up - don't assume that file will be there for any significant length of time! - if you are a single user on Windows, you have to run the "file cleanup" utility yourself!

    I would at least try making intermediate interface file before having to attempt complicated code to deal with this. You may be over-estimating the logistical requirements of a temporary interface file and under estimating the complexity of other solutions. The simple idea will be more easily portable.