1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 06:37:35 +00:00

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

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());