Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If you take the position that the semantics of read() are 'read data from this endless stream', then EOF is an error indicating that this model no longer applies.

Doesn't bother me at all.



Except in that model it would be fine to return an error as soon as soon as you know there is an EOF while in the real world you do want to read right up to the EOF because EOF is usually not an error condition but expected, even with streams of indeterminate length.


The model is that you don’t know there’s an EOF until after you’ve read the last data byte.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: