in reply to forking pipe open

Well, the fork() call is as well supported as dd and gzip :) (ie, not). If I read your example correctly, you seem to want to read a disk (in raw or character mode), gzip it and send it somewhere using something along the lines of netcat.

My first suggestion would be to write a few more lines of code and implement the whole thing in perl, which would allow you to run your task anywhere, without the overhead of multiple processes. Take a look at IO::Zlib and IO::Socket, which would do all the work for you.

Also note that in Win32, pipelines used to be very inefficient. The whole output of each member of the pipeline is executed up to completion and its output sent to a temporary file. Then the next member is fed with the temporary file and its output treated in a similar way, untill all the members have run. I would not be surprised if this were the case even today.

Regards.

Replies are listed 'Best First'.
Re: Re: forking pipe open
by Anonymous Monk on Aug 13, 2002 at 15:33 UTC
    Hey thanks good idea about using Zlib, i was already trying to replace netcat using the socket library anyways.

    The only program i just dont have a clue on how to get rid of would be ofcourse dd since i need to read a whole disc. any ideas man?