diff --git a/trunk/ConsoleDataMigration/sources/tools/CmacAdder/main.cpp b/trunk/ConsoleDataMigration/sources/tools/CmacAdder/main.cpp index c8c1f4c..1b7ef06 100644 --- a/trunk/ConsoleDataMigration/sources/tools/CmacAdder/main.cpp +++ b/trunk/ConsoleDataMigration/sources/tools/CmacAdder/main.cpp @@ -98,6 +98,7 @@ bool AddCmac(const wchar_t * from_path, void* buf, const size_t bufSize) s32 numread = 0; std::wostringstream target_from; std::wostringstream target_to; + std::wostringstream targetDirectory; bool ret_value = true; nn::Result result = from_dir.TryInitialize(from_path); @@ -108,6 +109,16 @@ bool AddCmac(const wchar_t * from_path, void* buf, const size_t bufSize) return false; } + // 出力先ディレクトリの作成 + const wchar_t* CMAC_DIR = L"CmacAdded/"; + targetDirectory << from_path << CMAC_DIR; + result = nn::fs::TryCreateDirectory(targetDirectory.str().c_str()); + if (result.IsFailure()) + { + COMMON_LOGGER_RESULT_IF_FAILED_WITH_LINE(result); + return false; + } + while (1) { result = from_dir.TryRead(&numread, &entry, 1); @@ -127,7 +138,7 @@ bool AddCmac(const wchar_t * from_path, void* buf, const size_t bufSize) target_to.str(L""); target_to.clear(std::stringstream::goodbit); - target_to << from_path << entry.entryName << L".cmac"; + target_to << from_path << CMAC_DIR << entry.entryName << L".cmac"; // ディレクトリの場合 if (entry.attributes.isDirectory)