-
Notifications
You must be signed in to change notification settings - Fork 77
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
Fix detect_compressed() #318
Conversation
and make detect_compression() uses it
Codecov Report
@@ Coverage Diff @@
## master #318 +/- ##
==========================================
+ Coverage 89.88% 90.22% +0.33%
==========================================
Files 10 10
Lines 623 624 +1
==========================================
+ Hits 560 563 +3
+ Misses 63 61 -2
Continue to review full report at Codecov.
|
50e9cbf
to
26c3a19
Compare
@timholy could you please take a look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious to ask, will it be better to use :GZIP
, :BZIP2
, :XZ
, :LZ4
and perhaps :plain
(or :uncompressed
) here?
FileIO v1.6.5 is out. |
Thanks for merging! |
The PR fixes a typo in BZIP2 magic bytes that is responsible for JuliaData/RData.jl#83 and adds unit tests for all supported compression formats.
I've also refactored the compression detection: now there is
detect_compressor()
function that returns the compression format code or nothing if no supported format detected.I would be using it from RData.jl instead of the compression detection code that is currently there to avoid code duplication.
Also, it could help in future when implementing the format detection of decompressed streams.
For example, the current version of FileIO checks for RData-specific magic bytes if the file is not compressed, but for compressed RData files it just checks the compression format but skips magic bytes check of the uncompressed stream (see also #225).
Once merged, it would be nice to tag a new version of FileIO, because the fix of JuliaData/RData.jl#83 depends on it.