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

the documentation on readavailable still makes it sounds like you might actually want to use this function #16821

Closed
zhmz90 opened this issue Jun 8, 2016 · 6 comments · Fixed by #36036
Labels
docs This change adds or pertains to documentation io Involving the I/O subsystem: libuv, read, write, etc.

Comments

@zhmz90
Copy link
Contributor

zhmz90 commented Jun 8, 2016

julia> f = open("../data/ref/ucsc.hg19/ucsc.hg19.fasta")
IOStream(<file ../data/ref/ucsc.hg19/ucsc.hg19.fasta>)

julia> readavailable(f)
0-element Array{UInt8,1}

julia> readline(f)
">chrM\n"

julia> readavailable(f)
131066-element Array{UInt8,1}:
 0x47
 0x41
 0x54
 0x43
......

julia> readavailable(f)
0-element Array{UInt8,1}

julia> readline(f)
"AATAGTAGGCACCTAATATTTGTTGAAAAGG\n"

julia> readavailable(f)
131040-element Array{UInt8,1}:
 0x41
 0x41
......

while readavailable(s::IOStream) is expected to read all available data on the stream.

My Julia is the latest:

julia> versioninfo()
Julia Version 0.5.0-dev+4582
Commit d98f2c0* (2016-06-07 22:00 UTC)
Platform Info:
  System: Linux (x86_64-linux-gnu)
  CPU: Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.7.1 (ORCJIT, haswell)

@vtjnash
Copy link
Member

vtjnash commented Jun 8, 2016

That's not what readavailable is expected to be able to do (that is what readall is for)

see #7478

@vtjnash vtjnash added system:32-bit Affects only 32-bit systems docs This change adds or pertains to documentation and removed system:32-bit Affects only 32-bit systems labels Jun 8, 2016
@vtjnash vtjnash changed the title Bug with method: readavailable(s::IOStream) the documentation on readavailable still makes it sounds like you might actually want to use this function Jun 8, 2016
@zhmz90
Copy link
Contributor Author

zhmz90 commented Jun 8, 2016

Thanks. @vtjnash

@tkelman tkelman added the io Involving the I/O subsystem: libuv, read, write, etc. label Jun 8, 2016
@StefanKarpinski
Copy link
Member

Can we just delete readavailable?

@StefanKarpinski
Copy link
Member

Kidding, kind of.

@kshyatt
Copy link
Contributor

kshyatt commented Jan 26, 2017

Did this get resolved? Do we want to deprecate this function or improve the docs in some way?

@vtjnash
Copy link
Member

vtjnash commented Jan 26, 2017

  readavailable(stream)

  Read all available data on the stream, blocking the task only if no data is
  available. The result is a Vector{UInt8,1}.

It looks like the documentation still makes it sound like you might want to try to use this method, so I think this is still not resolved.

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

Successfully merging a pull request may close this issue.

5 participants