unzip: Create parent directory before extracting files

This commit is contained in:
Tim Schumacher 2022-04-22 11:07:18 +02:00 committed by Linus Groh
parent f25123df66
commit a87c85f401
Notes: sideshowbarker 2024-07-17 11:30:06 +09:00

View File

@ -27,6 +27,7 @@ static bool unpack_zip_member(Archive::ZipMember zip_member, bool quiet)
outln(" extracting: {}", zip_member.name);
return true;
}
MUST(Core::Directory::create(LexicalPath(zip_member.name).parent(), Core::Directory::CreateDirectories::Yes));
auto new_file = Core::File::construct(zip_member.name);
if (!new_file->open(Core::OpenMode::WriteOnly)) {
warnln("Can't write file {}: {}", zip_member.name, new_file->error_string());