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

Fix #896 - Stream decompress zipped files #1106

Merged
merged 1 commit into from Jun 27, 2017

Conversation

cemeyer
Copy link
Contributor

@cemeyer cemeyer commented Jun 17, 2017

Use the POSIX fopencookie(3) mechanism to produce a FILE object, and
then treat them the same as other non-mmapable streams (i.e., FIFOs).

Since some supported platforms do not support fopencookie(3) (Mac OS X,
maybe Cygwin, older BSDs), retain non-streaming zip file support.

Existing tests pass.

Use the POSIX fopencookie(3) mechanism to produce a FILE object, and
then treat them the same as other non-mmapable streams (i.e., FIFOs).

Since some supported platforms do not support fopencookie(3) (Mac OS X,
maybe Cygwin, older BSDs), retain non-streaming zip file support.
@cemeyer
Copy link
Contributor Author

cemeyer commented Jun 27, 2017

For example, with a large compressed zero corpus (70 MB compressed, 281 GB uncompressed), this makes completion actually possible:

Before patch:

$ ag -z foo test.out.xz
ERR: Unable to allocate 691011584 bytes to decompress file test.out.xz
ERR: Cannot decompress zipped file test.out.xz

After patch:

$ time ./ag -z foo test.out.xz
./ag -z foo test.out.xz  10.21s user 1.14s system 99% cpu 11.375 total

@ggreer ggreer merged commit d10085c into ggreer:master Jun 27, 2017
@ggreer
Copy link
Owner

ggreer commented Jun 27, 2017

Wow, very nice!

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

Successfully merging this pull request may close these issues.

None yet

3 participants