diff --git a/src/core/fs/archive_ext_save_data.cpp b/src/core/fs/archive_ext_save_data.cpp index ca03b326..a39259c3 100644 --- a/src/core/fs/archive_ext_save_data.cpp +++ b/src/core/fs/archive_ext_save_data.cpp @@ -20,6 +20,7 @@ HorizonResult ExtSaveDataArchive::createFile(const FSPath& path, u64 size) { // Create a file of size "size" by creating an empty one, seeking to size - 1 and just writing a 0 there IOFile file(p.string().c_str(), "wb"); if (file.seek(size - 1, SEEK_SET) && file.writeBytes("", 1).second == 1) { + file.close(); return Result::Success; } diff --git a/src/core/fs/archive_save_data.cpp b/src/core/fs/archive_save_data.cpp index 1dcc1db8..af8841c9 100644 --- a/src/core/fs/archive_save_data.cpp +++ b/src/core/fs/archive_save_data.cpp @@ -19,11 +19,13 @@ HorizonResult SaveDataArchive::createFile(const FSPath& path, u64 size) { // If the size is 0, leave the file empty and return success if (size == 0) { + file.close(); return Result::Success; } // If it is not empty, seek to size - 1 and write a 0 to create a file of size "size" else if (file.seek(size - 1, SEEK_SET) && file.writeBytes("", 1).second == 1) { + file.close(); return Result::Success; }