-
Notifications
You must be signed in to change notification settings - Fork 45
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
Define nb_available for ZipFile.ReadableFile #39
Comments
This is the testing script: julia> using EzXML, ZipFile
julia> filepath="general.xlsx"; xlfile = ZipFile.Reader(filepath); f1=xlfile.files[1]
ZipFile.ReadableFile(name=[Content_Types].xml, method=Deflate, uncompresssedsize=2521, compressedsize=396, mtime=3.155436e8)
julia> doc = EzXML.readxml(f1)
ERROR: MethodError: no method matching nb_available(::ZipFile.ReadableFile)
Closest candidates are:
nb_available(::Base.Filesystem.File) at filesystem.jl:162
nb_available(::BufferStream) at stream.jl:1155
nb_available(::IOStream) at iostream.jl:185
...
Stacktrace:
[1] (::EzXML.##7#8)(::Ptr{Void}, ::Ptr{UInt8}, ::Int32) at /home/felipenoris/.julia/v0.6/EzXML/src/document.jl:203
[2] macro expansion at /home/felipenoris/.julia/v0.6/EzXML/src/error.jl:50 [inlined]
[3] readxml(::ZipFile.ReadableFile) at /home/felipenoris/.julia/v0.6/EzXML/src/document.jl:141 The file cc @bicycle1885 |
I think Line 453 in 2811b56
That's assuming the uncompressed size is accurate in the metadata. Maybe it's better to call Zlib's |
@fhs , thanks! That actually worked! Base.nb_available(f::ZipFile.ReadableFile) = f.uncompressedsize - f._pos |
I'm hitting this error when reading a XML file with EzXML.jl , when the XML is inside a zip file.
Is it possible to define this function?
The text was updated successfully, but these errors were encountered: