summaryrefslogtreecommitdiffstats
path: root/src/core/file_sys/disk_archive.cpp
diff options
context:
space:
mode:
authorSubv <subv2112@gmail.com>2015-12-28 15:59:27 +0100
committerSubv <subv2112@gmail.com>2016-03-20 20:28:14 +0100
commit09b0564c75c3da41eaf15dcb847831c11f4c27b9 (patch)
treedce86c99034cd11bbba6b599389c72e827fedbaa /src/core/file_sys/disk_archive.cpp
parentHLE/FS: Corrected the error codes for CreateFile (diff)
downloadyuzu-09b0564c75c3da41eaf15dcb847831c11f4c27b9.tar
yuzu-09b0564c75c3da41eaf15dcb847831c11f4c27b9.tar.gz
yuzu-09b0564c75c3da41eaf15dcb847831c11f4c27b9.tar.bz2
yuzu-09b0564c75c3da41eaf15dcb847831c11f4c27b9.tar.lz
yuzu-09b0564c75c3da41eaf15dcb847831c11f4c27b9.tar.xz
yuzu-09b0564c75c3da41eaf15dcb847831c11f4c27b9.tar.zst
yuzu-09b0564c75c3da41eaf15dcb847831c11f4c27b9.zip
Diffstat (limited to '')
-rw-r--r--src/core/file_sys/disk_archive.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/core/file_sys/disk_archive.cpp b/src/core/file_sys/disk_archive.cpp
index 5c68e944f..0c55a4863 100644
--- a/src/core/file_sys/disk_archive.cpp
+++ b/src/core/file_sys/disk_archive.cpp
@@ -25,8 +25,19 @@ std::unique_ptr<FileBackend> DiskArchive::OpenFile(const Path& path, const Mode
return std::move(file);
}
-bool DiskArchive::DeleteFile(const Path& path) const {
- return FileUtil::Delete(mount_point + path.AsString());
+ResultCode DiskArchive::DeleteFile(const Path& path) const {
+ std::string file_path = mount_point + path.AsString();
+
+ if (FileUtil::IsDirectory(file_path))
+ return ResultCode(ErrorDescription::FS_NotAFile, ErrorModule::FS, ErrorSummary::Canceled, ErrorLevel::Status);
+
+ if (!FileUtil::Exists(file_path))
+ return ResultCode(ErrorDescription::FS_NotFound, ErrorModule::FS, ErrorSummary::NotFound, ErrorLevel::Status);
+
+ if (FileUtil::Delete(file_path))
+ return RESULT_SUCCESS;
+
+ return ResultCode(ErrorDescription::FS_NotAFile, ErrorModule::FS, ErrorSummary::Canceled, ErrorLevel::Status);
}
bool DiskArchive::RenameFile(const Path& src_path, const Path& dest_path) const {