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(processing): delete successfully processed files. #766

Closed
wants to merge 1 commit into from

Conversation

qkaiser
Copy link
Contributor

@qkaiser qkaiser commented Feb 13, 2024

Delete the source file after extraction if the extraction was successful and the chunk being extracted covers the whole file.

Technical notes: A call to extract() does not return anything if everything went well (no unhandled exception, no extraction errors). Under those conditions, we could delete the source file if the --keep-extracted-chunks option is not set.

Relying on keep-extracted-chunks to make this decision is not ok since we're not technically operating on a chunk here. A chunk is something that was carved out of a file, here we're operating on a file that was extracted from an archive/filesystem.

Closely related to #326, triggered by #687

@qkaiser qkaiser added enhancement New feature or request help wanted Extra attention is needed labels Feb 13, 2024
@qkaiser qkaiser self-assigned this Feb 13, 2024
@qkaiser qkaiser marked this pull request as draft February 13, 2024 22:23
unblob/processing.py Outdated Show resolved Hide resolved
A call to extract does not return any result if everything went well (no
unhandled exception, no extraction errors).

Under those conditions, we delete the source file if the
--keep-extracted-chunks option is not set.
@martonilles
Copy link
Contributor

I would default to not deleting source files, a we can easily loose information and structure while doing so (there might be a reference to a file , which is further extracted and hence deleted).

Even though not sure we would benefit much by deleting files compared to the complexity

@qkaiser
Copy link
Contributor Author

qkaiser commented Feb 16, 2024

#687 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants