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

Base.IOBuffer documentation error #23398

Closed
samoconnor opened this issue Aug 22, 2017 · 1 comment
Closed

Base.IOBuffer documentation error #23398

samoconnor opened this issue Aug 22, 2017 · 1 comment
Labels
docs This change adds or pertains to documentation io Involving the I/O subsystem: libuv, read, write, etc.

Comments

@samoconnor
Copy link
Contributor

The doc for IOBuffer says:

IOBuffer([data,],[readable::Bool=true, writable::Bool=true, [maxsize::Int=typemax(Int)]])

Create an IOBuffer, which may optionally operate on a pre-existing array. If the readable/writable arguments are given, they restrict whether or not the buffer may be read from or written to respectively. By default the buffer is readable but not writable. The last argument optionally specifies a size beyond which the buffer may not be grown.

The part about "by default ... not writeable" is wrong.

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

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

I'm guessing that this may have lead people to use PipeBuffer() instead of IOBuffer() when they do not need seek() and all they are doing is a few writes to a buffer before take!-ing the result.

@fredrikekre fredrikekre added docs This change adds or pertains to documentation io Involving the I/O subsystem: libuv, read, write, etc. labels Aug 22, 2017
fredrikekre added a commit that referenced this issue Aug 30, 2017
@samoconnor
Copy link
Contributor Author

thx @fredrikekre

ararslan pushed a commit that referenced this issue Sep 11, 2017
ararslan pushed a commit that referenced this issue Sep 13, 2017
vtjnash pushed a commit that referenced this issue Sep 14, 2017
ararslan pushed a commit that referenced this issue Sep 15, 2017
ararslan pushed a commit that referenced this issue Sep 16, 2017
ararslan pushed a commit that referenced this issue Sep 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs This change adds or pertains to documentation io Involving the I/O subsystem: libuv, read, write, etc.
Projects
None yet
Development

No branches or pull requests

2 participants