summaryrefslogtreecommitdiffstats
path: root/src/core/file_sys
diff options
context:
space:
mode:
authorSubv <subv2112@gmail.com>2015-12-28 15:55:38 +0100
committerSubv <subv2112@gmail.com>2016-03-20 20:28:10 +0100
commitb350f192bbfe61a212e00ea70d4dcd7d3e90b60a (patch)
treee49a83653a6d8aa4fe8e8818393d86ecf3e525d9 /src/core/file_sys
parentHLE/FS: FS::CreateFile takes an u64 for the file size. (diff)
downloadyuzu-b350f192bbfe61a212e00ea70d4dcd7d3e90b60a.tar
yuzu-b350f192bbfe61a212e00ea70d4dcd7d3e90b60a.tar.gz
yuzu-b350f192bbfe61a212e00ea70d4dcd7d3e90b60a.tar.bz2
yuzu-b350f192bbfe61a212e00ea70d4dcd7d3e90b60a.tar.lz
yuzu-b350f192bbfe61a212e00ea70d4dcd7d3e90b60a.tar.xz
yuzu-b350f192bbfe61a212e00ea70d4dcd7d3e90b60a.tar.zst
yuzu-b350f192bbfe61a212e00ea70d4dcd7d3e90b60a.zip
Diffstat (limited to 'src/core/file_sys')
-rw-r--r--src/core/file_sys/disk_archive.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/core/file_sys/disk_archive.cpp b/src/core/file_sys/disk_archive.cpp
index 614c2e2a0..5c68e944f 100644
--- a/src/core/file_sys/disk_archive.cpp
+++ b/src/core/file_sys/disk_archive.cpp
@@ -40,8 +40,11 @@ bool DiskArchive::DeleteDirectory(const Path& path) const {
ResultCode DiskArchive::CreateFile(const FileSys::Path& path, u64 size) const {
std::string full_path = mount_point + path.AsString();
+ if (FileUtil::IsDirectory(full_path))
+ return ResultCode(ErrorDescription::FS_NotAFile, ErrorModule::FS, ErrorSummary::Canceled, ErrorLevel::Status);
+
if (FileUtil::Exists(full_path))
- return ResultCode(ErrorDescription::AlreadyExists, ErrorModule::FS, ErrorSummary::NothingHappened, ErrorLevel::Info);
+ return ResultCode(ErrorDescription::FS_AlreadyExists, ErrorModule::FS, ErrorSummary::NothingHappened, ErrorLevel::Status);
if (size == 0) {
FileUtil::CreateEmptyFile(full_path);