PƔdraig Brady <P@draigBrady.com> writes:
> I don't think getline() is a generic enough interface,
> especially for a utility used to introduce new lines.
>
> Consider for example you want 80x10 lines of "y",
> you could do this previously with:
>
> $ yes | tr -d '\n' | fold -w 80 | head -n 10
>
> While now fold will just consume all of memory.
> Instead you might fread() to an IO_BUFSIZE buffer?
Good point.
Using fread is also faster since it doesn't check for the delimiter upon
reading a character, and doesn't need to lock the stream each call
(since we use fread_unlocked).
Will push the attached in a bit.
Collin