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

[Feature Request]: Suggestions for Decompressing Callback Logic #162

Open
1 task done
psvajaz opened this issue Aug 9, 2023 · 1 comment
Open
1 task done

[Feature Request]: Suggestions for Decompressing Callback Logic #162

psvajaz opened this issue Aug 9, 2023 · 1 comment
Assignees

Comments

@psvajaz
Copy link

psvajaz commented Aug 9, 2023

Feature description

During the decompression process, the situation: when the setFileCallback is triggered during the decompression process, only the file name (without directory information) is provided and no callback is made when decompressing the directory. The return value of the Callback is only whether the current file needs to be decompressed.
Suggestion: When triggering the setFileCallback setting function during the decompression process, the item of the directory and the file should be used as the Callback parameter. In this way, the developer can display more comprehensive information to the user, allowing the user to choose how to operate; in the return of the Callback function In addition to whether to decompress the current file, the value should also provide the decompression path, so that the developer has more room for manipulation when the user chooses to overwrite or rename

Additional context

No response

Code of Conduct

@rikyoz
Copy link
Owner

rikyoz commented Aug 12, 2023

only the file name (without directory information) is provided

Not since the v4.0.0-rc, where the callback provides the full path of the file within the archive, not just its file name.

and no callback is made when decompressing the directory

The problem is that directories are not actually "extracted"; when bit7z encounters a directory item, it simply recreates it in the output folder.

When triggering the setFileCallback setting function during the decompression process, the item of the directory and the file should be used as the Callback parameter. In this way, the developer can display more comprehensive information to the user, allowing the user to choose how to operate

I'm evaluating whether to provide a const BitArchiveItem& parameter for the file callback.
This would give the user more information about the file being extracted.
But this would be a breaking change, so I'll evaluate it for a follow-up version (not for v4.0).

Another option would be adding a new "item" callback, which should also report directories.
But this would add some overhead to all the library's users.

in the return of the Callback function In addition to whether to decompress the current file, the value should also provide the decompression path, so that the developer has more room for manipulation when the user chooses to overwrite or rename

Returning the decompression path would make the API less easy to use for users not interested in manipulating such information.
But being able to overwrite or rename the extracted file is indeed helpful. I'll evaluate what's the best approach to support it.

Thanks for the suggestions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants