File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -442,10 +442,17 @@ ZipReader::extract_all(std::string const& output_dir)
442442 throw std::runtime_error (ss.str ());
443443 }
444444
445- // Write the output file .
445+ // Create the output directory if necessary .
446446 const std::filesystem::path path =
447447 std::filesystem::u8path (output_dir)
448448 / std::filesystem::u8path (file_name);
449+ const std::filesystem::path parent_path = path.parent_path ();
450+ if (!std::filesystem::exists (parent_path))
451+ {
452+ std::filesystem::create_directory (parent_path);
453+ }
454+
455+ // Write the output file.
449456 FileWrapper f (path.u8string (), " wb" );
450457 size_t count = fwrite (buf.data (), buf.size (), 1 , f ());
451458 if (count != 1 )
@@ -488,7 +495,6 @@ from_otioz(
488495
489496 // Create the directories.
490497 std::filesystem::create_directory (extract_path);
491- std::filesystem::create_directory (extract_path / media_dir);
492498
493499 // Extract the archive.
494500 zip.extract_all (extract_path.u8string ());
You can’t perform that action at this time.
0 commit comments