From 3fabe54cd6ae598f341cda2aa3f91e80814e37e4 Mon Sep 17 00:00:00 2001 From: N2614 Date: Wed, 21 Dec 2011 00:23:02 +0000 Subject: [PATCH] =?UTF-8?q?=E6=88=90=E6=9E=9C=E7=89=A9=E3=81=AE=E5=87=BA?= =?UTF-8?q?=E5=8A=9B=E5=85=88=E3=82=92=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_Repair@545 385bec56-5757-e545-9c3a-d8741f4650f1 --- .../sources/tools/CmacAdder/main.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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)