Discussion:
C library function that reads up to a newline
(too old to reply)
faif
2012-01-09 09:47:57 UTC
Permalink
read(2) reads up to N bytes but doesn't stop on newlines. Brdline(2)
looks like a good candidate for that. Are there any functions
outside Bio that behave similarly?
Jani Lahtinen
2012-01-09 11:11:36 UTC
Permalink
Dont' think so, as you need a buffer to keep the line.
Post by faif
read(2) reads up to N bytes but doesn't stop on newlines. Brdline(2)
looks like a good candidate for that. Are there any functions
outside Bio that behave similarly?
erik quanstrom
2012-01-09 14:18:42 UTC
Permalink
Post by faif
read(2) reads up to N bytes but doesn't stop on newlines. Brdline(2)
looks like a good candidate for that. Are there any functions
outside Bio that behave similarly?
if you're application is one where the producer is producing
a line at a time, then read(2) will read a line at a time; plan 9
doesn't coalesce writes. (raw tcp connections notwithstanding.)

- erik

Loading...