W
wing328hk
Hi,
I need to pipe a data stream to STDIN and I'm only interesting in the
first line so I do
my $header = <STDIN>;
To read the rest of the data stream, I do
do {
my $buf = "";
1 while (read(STDIN, $buf, 1024));
};
Would I get SIGPIPE if I don't use the do loop to get the rest of the
message?
Basically, how can I discard the rest of the message from STDIN? The
data stream can be huge (30MB...) and that's why I don't want to waste
CPU time in reading something I don't need.
Would it make a different to above questions if the above code is part
of a child process and there will be several child processes running
simultaneously reading from different data stream from pipe??
Thanks,
wing328hk
I need to pipe a data stream to STDIN and I'm only interesting in the
first line so I do
my $header = <STDIN>;
To read the rest of the data stream, I do
do {
my $buf = "";
1 while (read(STDIN, $buf, 1024));
};
Would I get SIGPIPE if I don't use the do loop to get the rest of the
message?
Basically, how can I discard the rest of the message from STDIN? The
data stream can be huge (30MB...) and that's why I don't want to waste
CPU time in reading something I don't need.
Would it make a different to above questions if the above code is part
of a child process and there will be several child processes running
simultaneously reading from different data stream from pipe??
Thanks,
wing328hk