mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:57:45 +00:00
unzip: Create parent directory before extracting files
This commit is contained in:
parent
f25123df66
commit
a87c85f401
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