Fix issues with not existing dirs for MultiPartArchiveWriter
This commit is contained in:
@@ -18,7 +18,7 @@ namespace openVulkanoCpp
|
||||
: m_fileSizeLimit(sizeLimit), m_archiveId(0), m_archiveConfig(archiveConfiguration)
|
||||
, m_dir(dir), m_fileNamePattern(fileNamePattern), m_logger(logger)
|
||||
{
|
||||
if (!std::filesystem::exists(m_dir))
|
||||
if (!m_dir.empty() && !std::filesystem::exists(m_dir))
|
||||
{
|
||||
std::filesystem::create_directories(m_dir);
|
||||
}
|
||||
@@ -72,6 +72,10 @@ namespace openVulkanoCpp
|
||||
{
|
||||
bool hasToMove = m_archives.size() > 1 || m_writer->GetTotalWrittenBytes() > 0;
|
||||
m_writer = nullptr; // Close current archive
|
||||
if (!newDir.empty() && !std::filesystem::exists(newDir))
|
||||
{
|
||||
std::filesystem::create_directories(newDir);
|
||||
}
|
||||
if (hasToMove)
|
||||
{ // Move all existing archives
|
||||
std::vector<std::filesystem::path> newArchivePaths;
|
||||
|
||||
Reference in New Issue
Block a user