schveiguy / io

Core I/O functionality
Boost Software License 1.0
25 stars 9 forks source link

Provide a EOF function #22

Closed damianday closed 5 years ago

damianday commented 5 years ago

I know it's trivial to just check returned value from read or write but it would be nicer syntactically and mentally.

schveiguy commented 5 years ago

This doesn't seem possible. std.io does not buffer data, and so cannot store data we might read to check this anywhere. We are just wrapping the OS primitives, so there's nowhere to put this information. I'd suggest picking a higher level library (such as iopipe) which can store this (this might be a good addition to iopipe, maybe file an issue there so I remember).