aboutsummaryrefslogtreecommitdiff
path: root/src/core/file_sys/disk_filesystem.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-04-15 13:15:18 -0400
committerbunnei <bunneidev@gmail.com>2018-04-15 13:15:18 -0400
commitbddad50dd400b31849fbd9486637fa9a2522cf58 (patch)
treef8e66493abf7fd870e6e98ed3d13b31e61a71b08 /src/core/file_sys/disk_filesystem.cpp
parent34264879b359107ec0c2fdb6af4b17faf52e4a6a (diff)
fsp_srv: Implement DeleteFile.
- Used by Binding of Isaac.
Diffstat (limited to 'src/core/file_sys/disk_filesystem.cpp')
-rw-r--r--src/core/file_sys/disk_filesystem.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/core/file_sys/disk_filesystem.cpp b/src/core/file_sys/disk_filesystem.cpp
index 4235f3935..263392930 100644
--- a/src/core/file_sys/disk_filesystem.cpp
+++ b/src/core/file_sys/disk_filesystem.cpp
@@ -57,10 +57,14 @@ ResultVal<std::unique_ptr<StorageBackend>> Disk_FileSystem::OpenFile(const std::
std::make_unique<Disk_Storage>(std::move(file)));
}
-ResultCode Disk_FileSystem::DeleteFile(const Path& path) const {
- LOG_WARNING(Service_FS, "(STUBBED) called");
- // TODO(bunnei): Use correct error code
- return ResultCode(-1);
+ResultCode Disk_FileSystem::DeleteFile(const std::string& path) const {
+ if (!FileUtil::Exists(path)) {
+ return ERROR_PATH_NOT_FOUND;
+ }
+
+ FileUtil::Delete(path);
+
+ return RESULT_SUCCESS;
}
ResultCode Disk_FileSystem::RenameFile(const Path& src_path, const Path& dest_path) const {