bug-coreutils
[Top][All Lists]
Advanced

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

Re: Improved tail patch


From: Andreas Schwab
Subject: Re: Improved tail patch
Date: Thu, 22 Jul 2004 11:53:37 +0200
User-agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux)

address@hidden writes:

> You could of course use things like feof and such, except that GNU tail
> currently uses file-descriptor-based methods rather than stream based
> ones, and feof only works on streams. So you'd need to re-write the lot.

feof won't buy you anything, it can only report EOF after a previous fgetc
has read past EOF.  And doing non-blocking I/O on streams is messy at
best.

> And even then feof basically does a getc to check if it gets EOF I
> beleive (could be wrong there).

feof uses the remembered result from the last call to fgetc (directly or
indirectly).  Don't mix that with Pascal's eof function, which indeed does
a read-ahead.

Andreas.

-- 
Andreas Schwab, SuSE Labs, address@hidden
SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




reply via email to

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