Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

write on IOBuffer with a maxsize #10292

Open
amitmurthy opened this issue Feb 23, 2015 · 3 comments
Open

write on IOBuffer with a maxsize #10292

amitmurthy opened this issue Feb 23, 2015 · 3 comments
Labels
breaking This change will break code io Involving the I/O subsystem: libuv, read, write, etc. needs decision A decision on this change is needed

Comments

@amitmurthy
Copy link
Contributor

Currently, a write on a full IOBuffer, just returns 0.

julia> io=IOBuffer(1)
IOBuffer(data=UInt8[...], readable=true, writable=true, seekable=true, append=false, size=0, maxsize=1, ptr=1, mark=-1)

julia> write(io, uint8(1))
1

julia> write(io, uint8(1))
0

julia> write(io, "Hello")
0

If this is by design, then we should update the documentation to highlight it. Else we should throw an error.

My preference would be for the latter.

@JeffBezanson
Copy link
Member

An error could be very useful for limited-output printing, as in #9481 and #10256

@JeffBezanson JeffBezanson added needs decision A decision on this change is needed io Involving the I/O subsystem: libuv, read, write, etc. labels Feb 23, 2015
@StefanKarpinski StefanKarpinski added this to the 0.6.0 milestone Sep 13, 2016
@tkelman
Copy link
Contributor

tkelman commented Jan 5, 2017

doesn't seem release-blocking

@tkelman tkelman removed this from the 0.6.0 milestone Jan 5, 2017
@brenhinkeller
Copy link
Contributor

Looks like this is still true as of 1.8.3:

julia> io=IOBuffer(maxsize=1)
IOBuffer(data=UInt8[...], readable=true, writable=true, seekable=true, append=false, size=0, maxsize=1, ptr=1, mark=-1)

julia> write(io, UInt8(1))
1

julia> write(io, UInt8(1))
0

julia> write(io, UInt8(1))
0

which I suppose effectively means that this is either now the intended behavior and can possibly be closed, or if not could be added to the 2.0 milestone?

@brenhinkeller brenhinkeller added the breaking This change will break code label Nov 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking This change will break code io Involving the I/O subsystem: libuv, read, write, etc. needs decision A decision on this change is needed
Projects
None yet
Development

No branches or pull requests

5 participants