mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-05 09:06:08 +00:00
unzip: Create parent directory before extracting files
This commit is contained in:
parent
f25123df66
commit
a87c85f401
Notes:
sideshowbarker
2024-07-17 11:30:06 +09:00
Author: https://github.com/timschumi
Commit: a87c85f401
Pull-request: https://github.com/SerenityOS/serenity/pull/13801
Reviewed-by: https://github.com/linusg
1 changed files with 1 additions and 0 deletions
|
@ -27,6 +27,7 @@ static bool unpack_zip_member(Archive::ZipMember zip_member, bool quiet)
|
||||||
outln(" extracting: {}", zip_member.name);
|
outln(" extracting: {}", zip_member.name);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
MUST(Core::Directory::create(LexicalPath(zip_member.name).parent(), Core::Directory::CreateDirectories::Yes));
|
||||||
auto new_file = Core::File::construct(zip_member.name);
|
auto new_file = Core::File::construct(zip_member.name);
|
||||||
if (!new_file->open(Core::OpenMode::WriteOnly)) {
|
if (!new_file->open(Core::OpenMode::WriteOnly)) {
|
||||||
warnln("Can't write file {}: {}", zip_member.name, new_file->error_string());
|
warnln("Can't write file {}: {}", zip_member.name, new_file->error_string());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue