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

std.zip: Add strip_components to extract options #20257

Open
trnxdev opened this issue Jun 11, 2024 · 1 comment
Open

std.zip: Add strip_components to extract options #20257

trnxdev opened this issue Jun 11, 2024 · 1 comment
Labels
enhancement Solving this issue will likely involve adding new logic or components to the codebase. standard library This issue involves writing Zig code for the standard library.
Milestone

Comments

@trnxdev
Copy link

trnxdev commented Jun 11, 2024

std.tar.pipeToFileSystem() has it but std.zip.extract() does not, so would be nice if std.zip implemented something like that.

strip_components is usually set to 0 (by default) or 1, if the option is set to 1 it won't extract the root folder but rather the contents in the folder.

Out of context: Currently in my own project I have to extract the zip in a temporary folder, get the root folder, move/rename the root folder to the appropriate destination and then remove the temporary directory. Don't judge me for that. I'm just saying what I am doing currently.

@hippietrail
Copy link

I've already started looking into implementing this. New here but seems I can't assign myself...

@Vexu Vexu added enhancement Solving this issue will likely involve adding new logic or components to the codebase. standard library This issue involves writing Zig code for the standard library. labels Jun 11, 2024
@Vexu Vexu added this to the 0.14.0 milestone Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Solving this issue will likely involve adding new logic or components to the codebase. standard library This issue involves writing Zig code for the standard library.
Projects
None yet
Development

No branches or pull requests

3 participants