DragonFly BSD
DragonFly bugs List (threaded) for 2004-02
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Pipe woes (not DF specific I guess)


From: "Simon 'corecode' Schubert" <corecode@xxxxxxxxxxxx>
Date: Thu, 5 Feb 2004 14:48:41 +0100

Heyas,

While doing some shell-fu (with grep and tee) I once again noted that pipes don't really work the way I'd like them to work: Be line buffered (not fully buffered) when the final output is a terminal.

This - of course doesn't work automatically. But a nice thing would be some way to declare a pipe as line oriented...

But first things first: A small test visualize pipe effects

% sh pipetest.shar
% cd pipetest
% make test

result:
Testing standard pipe...
. /writer | ./reader 20
200
200
200
200
200
200
200
200
200
200
200
200
200
200
200
200
200
200
200
200

Testing double pipe...
. /writer | grep a | ./reader 20
1000
1000
1000
1000
1000
1000
1000
1000
1000
1000
1000
1000
1000
1000
1000
1000
384
1000
1000
1000

i.e. A single pipe transports each write, a double one (except with `cat') buffers completely (here: 16384 bytes)

Joerg wrote an approach with nonblocking IO and polling, but actually I'd like to have some more generic thing, where not every involved program needs to be changed.

cheers
  simon

ps: or is there something I'm missing?

Attachment: pipetest.shar
Description: Unix shell archive


-- /"\ http://corecode.ath.cx/#donate \ / \ ASCII Ribbon Campaign / \ Against HTML Mail and News

Attachment: PGP.sig
Description: This is a digitally signed message part



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]