juliaio / codecxz.jl Goto Github PK
View Code? Open in Web Editor NEWAn xz codec for TranscodingStreams.jl.
License: Other
An xz codec for TranscodingStreams.jl.
License: Other
I'm using the following code using CodecXz and CodecGzip/Bzip2 (slightly simplified):
function open_xz(f::Function, filename::String, mode::String)
return if mode == "w"
Base.open(f, CodecXz.XzDecompressorStream, filename, mode)
elseif mode == "r"
Base.open(f, CodecXz.XzCompressorStream, filename, mode)
end
end
function open_bz2(f::Function, filename::String, mode::String)
return if mode == "w"
Base.open(f, CodecBzip2.Bzip2CompressorStream, filename, mode)
elseif mode == "r"
Base.open(f, CodecBzip2.Bzip2DecompressorStream, filename, mode)
end
end
However similar, though, the two codes do not behave the same. When creating a new file, with mode="w"
, the Bzip2/Gz code works, but not the Xz one. It fails with the following error:
lzma error: code = 7
Stacktrace:
[1] changemode!(::TranscodingStreams.TranscodingStream{XzDecompressor,IOStream}, ::Symbol) at C:\Users\Thibaut\.julia\packages\TranscodingStreams\MsN8d\src\stream.jl:717
[2] callprocess(::TranscodingStreams.TranscodingStream{XzDecompressor,IOStream}, ::TranscodingStreams.Buffer, ::TranscodingStreams.Buffer) at C:\Users\Thibaut\.julia\packages\TranscodingStreams\MsN8d\src\stream.jl:649
[3] flushbuffer(::TranscodingStreams.TranscodingStream{XzDecompressor,IOStream}, ::Bool) at C:\Users\Thibaut\.julia\packages\TranscodingStreams\MsN8d\src\stream.jl:594
[4] flushbufferall at C:\Users\Thibaut\.julia\packages\TranscodingStreams\MsN8d\src\stream.jl:601 [inlined]
[5] changemode!(::TranscodingStreams.TranscodingStream{XzDecompressor,IOStream}, ::Symbol) at C:\Users\Thibaut\.julia\packages\TranscodingStreams\MsN8d\src\stream.jl:740
[6] close(::TranscodingStreams.TranscodingStream{XzDecompressor,IOStream}) at C:\Users\Thibaut\.julia\packages\TranscodingStreams\MsN8d\src\stream.jl:174
[7] open(::MathOptFormat.var"##7#8"{MathOptFormat.MPS.InnerModel{Float64}}, ::Type{TranscodingStreams.TranscodingStream{XzDecompressor,S} where S<:IO}, ::String, ::String) at C:\Users\Thibaut\.julia\packages\TranscodingStreams\MsN8d\src\stream.jl:163
[8] _compressed_open at C:\Users\Thibaut\.julia\dev\MathOptFormat\src\compression.jl:55 [inlined]
Here is my version of Julia:
julia> versioninfo()
Julia Version 1.3.0-rc2.0
Commit a04936e3e0 (2019-09-12 19:49 UTC)
Platform Info:
OS: Windows (x86_64-w64-mingw32)
CPU: Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-6.0.1 (ORCJIT, skylake)
As this code works for Bzip2 and Gz, I suppose the problem lies with Xz.
Not a bug or issue, but I just wanted to say thank you for this package!
For reference, I read a compressed csv file as such:
using CodecXz, Queryverse
df = open(XzDecompressorStream, filename) do stream
DataFrame(load(Stream(format"CSV", stream)))
end
Thanks again!
cheers
(feel free to close ;)
This issue is used to trigger TagBot; feel free to unsubscribe.
If you haven't already, you should update your TagBot.yml
to include issue comment triggers.
Please see this post on Discourse for instructions and more details.
If you'd like for me to do this for you, comment TagBot fix
on this issue.
I'll open a PR within a few hours, please be patient!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.