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

position (for an approximate progress bar) #23

Open
tpapp opened this issue Jul 13, 2018 · 0 comments
Open

position (for an approximate progress bar) #23

tpapp opened this issue Jul 13, 2018 · 0 comments

Comments

@tpapp
Copy link

tpapp commented Jul 13, 2018

I am reading and processing a large gzip-compressed file and want to show some progress information, preferably with ProgressMeter.jl, which has the following idiom:

seekend(io)
fileSize = position(io)
seekstart(io)
p = Progress(fileSize, 1)   # minimum update interval: 1 second
while !eof(io)
    line = readline(io)
    # Here's where you do all the hard, slow work
    
    update!(p, position(io))
end

In the example above, io would come from a GzipDecompressorStream. But

julia> position(io)
ERROR: MethodError: no method matching position(::TranscodingStreams.TranscodingStream{CodecZlib.GzipDecompressor,IOStream})

I understand that the position may not be clearly defined because of buffering, but since seekend and seekstart are supported, is it possible to get eg the position of the original stream?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant