This is doomed to fail as most compression programs are likely to start producing output before having read the entire input stream so you'll get a deadlock unless your data is very small.
First, the operating system buffer for the pipe that the compression program is writing to fills up. Then the compression program tries to write more data out and this hangs waiting for the pipe to be drained (at least partially). This stops the compression program from reading further input. So soon the other pipe's buffer fills up. Then your Perl script tries to write to it and hangs waiting for that pipe to be drained (at least partially).
Finally the two processes just sit around waiting for each other to drain their pipes which never happens and eventually you get tired of waiting and kill them.
- tyeIn reply to Re: Help!: Open2 Hangs on Windows (doomed)
by tye
in thread Help!: Open2 Hangs on Windows
by coppit
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |