[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: cat and nonblocking
From:       Denys Vlasenko <vda.linux () googlemail ! com>
Date:       2008-03-31 19:46:38
Message-ID: 200803312146.38812.vda.linux () googlemail ! com
[Download RAW message or body]

On Monday 31 March 2008 17:05, James Simmons wrote:
> 
> > On Monday 31 March 2008 16:40, James Simmons wrote:
> > > 
> > > > # { echo TEST; sleep 1; } | { ./nonblocking; cat; ./blocking; } >result
> > > > cat: read error: Resource temporarily unavailable
> > > > 
> > > > and file "result" contains "TEST", as expected. -- vda
> > > 
> > > For my case I have ` cat /var/log/test | more ` where the test log is a 
> > > ring buffer.
> > 
> > I do not understand what do you mean by "ring buffer" here.
> > 
> > > Without the patch cat will read the file but then just sit  
> > > there once it reaches the end.
> > 
> > Really? I think cat exits when it reaches end-of-file.
> 
> Yes it does. The problem is emlog never has a end-of-file.

Aha. I see. In this case, my first example:

{ ./nonblocking; cat; ./blocking; } <emlog_pipe >result

will work as you want it to: it will read entire emlog
and exit as soon as it get EAGAIN.
--
vda
_______________________________________________
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic