GNU bug report logs -
#50129
-f - option doesn't respond to single EOF from TTY.
Previous Next
Reported by: Kaz Kylheku <kaz <at> kylheku.com>
Date: Fri, 20 Aug 2021 01:01:01 UTC
Severity: normal
Done: Paul Eggert <eggert <at> cs.ucla.edu>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
I'd guess you're seeing some of the design decisions in stdio,
that were rather "controversial", back around Version 7 Unix,
inside Bell Labs, circa late 1978, when stdio was first introduced.
I've avoided using fread(3S) "forever", even to the point of rolling
my own i/o buffering library, the most recent incarnation of which
can be found at https://github.com/ThePythonicCow/rawscan
The fixed input buffer size of my 'rawscan' probably makes it unsuitable
for most uses such as GNU grep that expect to handle arbitrarily long
input lines. This 'rawscan' scans over and otherwise ignores the tail end
of any input line that exceeds the line length you specified when opening
the buffer stream.
On a very large test case rather carefully chosen to highlight the
performance of rawscan, it was over twice as fast searching for
a fixed pattern than was grep. See the "Comparative Performance"
section of rawscan's github page for these results:
https://github.com/ThePythonicCow/rawscan
--
Paul Jackson
pj <at> usa.net
This bug report was last modified 3 years and 276 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.