-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Open
Labels
ioInvolving the I/O subsystem: libuv, read, write, etc.Involving the I/O subsystem: libuv, read, write, etc.
Description
What does isreadable mean? The documentation states:
Return false if the specified IO object is not readable.
Well, that's unhelpful.
Here are some plausible meanings of isreadable(io::MyIO):
- You can read from
io, and get some bytes from doing it. - You can call
readonio, but it might be EOF, so you might not get any bytes
The unfortunate current situation is that DevNull follows 1, and IOStream and IOBuffer follows 2:
julia> #devnull acts as a readable, but EOF stream
isreadable(devnull)
false
julia> read(devnull)
UInt8[]
julia> buf = IOBuffer(); isreadable(buf)
true
julia> close(buf); isreadable(buf)
falseProbably this is just wrong for devnull and should be changed. I'll make a PR
Metadata
Metadata
Assignees
Labels
ioInvolving the I/O subsystem: libuv, read, write, etc.Involving the I/O subsystem: libuv, read, write, etc.