From 381a5c053f76a7d85d811ebf37a5943f6a57579e Mon Sep 17 00:00:00 2001 From: Subv Date: Mon, 28 Dec 2015 09:38:10 -0500 Subject: HLE/FS: FS::CreateFile takes an u64 for the file size. --- src/core/file_sys/ivfc_archive.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core/file_sys/ivfc_archive.cpp') diff --git a/src/core/file_sys/ivfc_archive.cpp b/src/core/file_sys/ivfc_archive.cpp index 2efc31a8c..5325afb58 100644 --- a/src/core/file_sys/ivfc_archive.cpp +++ b/src/core/file_sys/ivfc_archive.cpp @@ -39,7 +39,7 @@ bool IVFCArchive::DeleteDirectory(const Path& path) const { return false; } -ResultCode IVFCArchive::CreateFile(const Path& path, u32 size) const { +ResultCode IVFCArchive::CreateFile(const Path& path, u64 size) const { LOG_CRITICAL(Service_FS, "Attempted to create a file in an IVFC archive (%s).", GetName().c_str()); // TODO: Verify error code return ResultCode(ErrorDescription::NotAuthorized, ErrorModule::FS, ErrorSummary::NotSupported, ErrorLevel::Permanent); -- cgit v1.2.3 From 09b0564c75c3da41eaf15dcb847831c11f4c27b9 Mon Sep 17 00:00:00 2001 From: Subv Date: Mon, 28 Dec 2015 09:59:27 -0500 Subject: HLE/FS: Corrected the error codes for DeleteFile --- src/core/file_sys/ivfc_archive.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/core/file_sys/ivfc_archive.cpp') diff --git a/src/core/file_sys/ivfc_archive.cpp b/src/core/file_sys/ivfc_archive.cpp index 5325afb58..f2f96ef1a 100644 --- a/src/core/file_sys/ivfc_archive.cpp +++ b/src/core/file_sys/ivfc_archive.cpp @@ -24,9 +24,11 @@ std::unique_ptr IVFCArchive::OpenFile(const Path& path, const Mode return Common::make_unique(romfs_file, data_offset, data_size); } -bool IVFCArchive::DeleteFile(const Path& path) const { +ResultCode IVFCArchive::DeleteFile(const Path& path) const { LOG_CRITICAL(Service_FS, "Attempted to delete a file from an IVFC archive (%s).", GetName().c_str()); - return false; + // TODO(Subv): Verify error code + return ResultCode(ErrorDescription::NoData, ErrorModule::FS, + ErrorSummary::Canceled, ErrorLevel::Status); } bool IVFCArchive::RenameFile(const Path& src_path, const Path& dest_path) const { -- cgit v1.2.3 From 96f0e32f836b19edb3d14ce4f87a7aed1ac6a8e1 Mon Sep 17 00:00:00 2001 From: Subv Date: Mon, 28 Dec 2015 10:03:09 -0500 Subject: HLE/FS: Return the proper error codes on file Read/Write operations. These operations are limited by the open flags specified while opening the file. --- src/core/file_sys/ivfc_archive.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/core/file_sys/ivfc_archive.cpp') diff --git a/src/core/file_sys/ivfc_archive.cpp b/src/core/file_sys/ivfc_archive.cpp index f2f96ef1a..e7b37e09d 100644 --- a/src/core/file_sys/ivfc_archive.cpp +++ b/src/core/file_sys/ivfc_archive.cpp @@ -68,17 +68,18 @@ u64 IVFCArchive::GetFreeBytes() const { //////////////////////////////////////////////////////////////////////////////////////////////////// -size_t IVFCFile::Read(const u64 offset, const size_t length, u8* buffer) const { +ResultVal IVFCFile::Read(const u64 offset, const size_t length, u8* buffer) const { LOG_TRACE(Service_FS, "called offset=%llu, length=%zu", offset, length); romfs_file->Seek(data_offset + offset, SEEK_SET); size_t read_length = (size_t)std::min((u64)length, data_size - offset); - return romfs_file->ReadBytes(buffer, read_length); + return MakeResult(romfs_file->ReadBytes(buffer, read_length)); } -size_t IVFCFile::Write(const u64 offset, const size_t length, const bool flush, const u8* buffer) const { +ResultVal IVFCFile::Write(const u64 offset, const size_t length, const bool flush, const u8* buffer) const { LOG_ERROR(Service_FS, "Attempted to write to IVFC file"); - return 0; + // TODO(Subv): Find error code + return MakeResult(0); } u64 IVFCFile::GetSize() const { -- cgit v1.2.3 From 95b34f8081e26cfe75d63a853d1626fdd5b636e6 Mon Sep 17 00:00:00 2001 From: Subv Date: Mon, 28 Dec 2015 10:17:06 -0500 Subject: HLE/FS: Return the proper error codes when opening files. --- src/core/file_sys/ivfc_archive.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/core/file_sys/ivfc_archive.cpp') diff --git a/src/core/file_sys/ivfc_archive.cpp b/src/core/file_sys/ivfc_archive.cpp index e7b37e09d..a8e9a72ef 100644 --- a/src/core/file_sys/ivfc_archive.cpp +++ b/src/core/file_sys/ivfc_archive.cpp @@ -20,8 +20,8 @@ std::string IVFCArchive::GetName() const { return "IVFC"; } -std::unique_ptr IVFCArchive::OpenFile(const Path& path, const Mode mode) const { - return Common::make_unique(romfs_file, data_offset, data_size); +ResultVal> IVFCArchive::OpenFile(const Path& path, const Mode mode) const { + return MakeResult>(Common::make_unique(romfs_file, data_offset, data_size)); } ResultCode IVFCArchive::DeleteFile(const Path& path) const { -- cgit v1.2.3