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

Allow early termination after n files have been extracted #134

Open
jamesrhester opened this issue Feb 23, 2022 · 0 comments
Open

Allow early termination after n files have been extracted #134

jamesrhester opened this issue Feb 23, 2022 · 0 comments

Comments

@jamesrhester
Copy link

GNU Tar has an --occurrence option which allows tar to terminate early after n occurrences of the file have been extracted. Something similar would be useful for Julia Tar so that time and bytes can be saved when only a part of the archive is needed.

I've tried using the predicate function to recreate this functionality by closing the io stream once the next header after the extracted file is being processed, but the error caused by the premature closing of the stream can lead to the extracted file not being written to disk before everything is torn down (or at least the extracted file is missing, I assume this is the reason).

An alternative solution would be to expose the io stream for the extracted file so that it could be explicitly flushed.

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

No branches or pull requests

1 participant