On Sat, 02 Jun 2012 18:04:41 -0700
Zac Medico <zmed...@gentoo.org> wrote:

> #!/usr/bin/env bash
> named_pipe=$(mktemp -d)/fifo
> 
> (
>       # hold the pipe open in read mode, so
>       # the writer doesn't block
>       sleep 3
> ) < "$named_pipe" &

I don't understand this part. This keeps the pipe open for reading
which obviously causes it to lose data. If you open it, you need to
read all that is there and then close.

And writers are supposed to be blocked. They are forked and just write
when done, so there's no problem with keeping them alive for a short
while.

-- 
Best regards,
Michał Górny

Attachment: signature.asc
Description: PGP signature

Reply via email to