Skip to content

Commit 46b929c

Browse files
committed
Revert change
Signed-off-by: Darby Johnston <darbyjohnston@yahoo.com>
1 parent 5db9a64 commit 46b929c

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/opentimelineio/otioz.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff 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());

0 commit comments

Comments
 (0)