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

Enable streaming output #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Enable streaming output #4

wants to merge 2 commits into from

Conversation

root9b-zz
Copy link

Originally written for https://gist.github.com/root9b/65f0236128ba11a44cdb00e29e5ab81b/ and may be useful to others.

gizlu added a commit to gizlu/sunzip-stout that referenced this pull request Jun 19, 2022
Program specified by user (currently hardcoded) will be invoked,
the contents of the file being extracted supplied to its stdin,
and its stdout saved instead of original file. It is something like
`--to-command` from GNU tar

I think it is way more universal than madler#4
which is kind of useless when you have more than one file in archive
(and care about outputed filenames)

Unfortunately prog's exit code is curently ignored - sunzip will keep running
even if prog fail. This kinda suck, but it hugely simplifies integration with
programs that panic on unrecognized input.

TODO:
- Add CLI (prog is curently hard-set to `tac` for testing purposes)
- Improve child cleanup
- Add option to enable exit code checking or at least inform on which files error occured
- Add support for non-posix systems or at least make it optional feature
  (currently build on non-posix will probably fail)
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

1 participant