-
Notifications
You must be signed in to change notification settings - Fork 36
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
gunzip truncates concatinated gzip streams #56
Comments
Actually, I'm wondering if io-streams zlib integration is incomplete, because it also appears the output is getting truncated on the first day of the month. |
Ok, it turns out that it's entirely legitimate to concatinate gz streams, and So for example:
So my "minimal reimplementation" of At the very least, this needs to be mentioned in the documentation. And we probably need to implement a proper |
And, as it turns out, this doesn't work:
The issue is that the first time |
Alright, I inspected the So at the very least, we are going to have to port the patches from |
Ok, as far as So, I'd be willing to make the changes necessary to |
What would we need to add to zlib to keep io-streams free of streaming-commons? |
This appears to be the relevant patch to |
@lpsmith btw, I really meant Not too long ago I imported |
@hvr, ahh, thank you for the clarification. Eyeballing it, it would appear that the So it looks like, as of last year, there is nothing preventing |
@lpsmith ah, now I think I remember what the missing thing was: flushing support in the compression-stream. That's where the API I imitated for http://hackage.haskell.org/package/lzma-0.0.0.2/docs/Codec-Compression-Lzma.html#t:CompressStream Note the additional field in I'll talk to @dcoutts, but I think after adding support for flushing (haskell/zlib#6) we should promote the incremental API into a non- |
Well, I'm looking at just decompression at the moment, and don't anticipate needing compression anytime soon on my current project. I should probably code up a proof of concept though. |
Hmm, actually, your lzma package looks very nice. I might adopt it in some of my projects; last time I looked at lzma bindings on hackage, I decided to stick to piping my data through xz subprocesses instead. |
Ok, I have a proof of concept done for the decompression side. Take a look at lpsmith/io-streams@f39178b |
Needs more testing, review, and work: 1. Update the test suite 2. Research the issue of concatinating zlib streams 3. Review various semantic considerations, especially in relation to the unix command "gunzip" But, it works for me
I ran across this issue when working on my ftp-monitor project.
Anyway, here's a fairly minimal reimplementation of zcat, which is sufficient to demonstrate the problem:
Now, if I run this on a big file, it truncates output. (Curiously, it seems to be truncating output on a newline on this and several other files).
I'll be investigating this more deeply and see if I can't track down the problem, but it would appear that the bug is with io-streams.
The text was updated successfully, but these errors were encountered: