bug-coreutils
[Top][All Lists]
Advanced

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

Re: Improved tail patch


From: tigger
Subject: Re: Improved tail patch
Date: Thu, 22 Jul 2004 09:25:35 +0000
User-agent: Mutt/1.5.6i

On Thu, Jul 22, 2004 at 12:49:51AM -0400, Paul Jarc wrote:
> address@hidden wrote:
> > Select always returns ready for a fifo.
> 
> No.  It always returns ready for a regular file.  For a pipe or
> socket, it returns nonready if there is a writer on the other end, but
> there is no data to read.  To see this, try
> "{ sleep 60; echo foo; } > /tmp/test.fifo" and let the reader call
> select during the sleep.  In your tests, the writer exits immediately,
> which signals EOF.  So read() will return EOF without blocking in that
> case, and select() reports that.

Ahhh....this makes more sense now. I apologise for misunderstanding
that.

This also explains why if I opened the fifo as O_RDRW (yuk) I never saw
the EOF, because there was always a writer (itself).

So maybe select would help *shrugs*

Needs to be sorted either way :)

-- 
rob holland - [ address@hidden ]
[ 5251 4FAC D684 8845 5604  E44F D65C 392F D91B 4729 ]

Attachment: pgptdRgnVBj4u.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]