From bddad50dd400b31849fbd9486637fa9a2522cf58 Mon Sep 17 00:00:00 2001 From: bunnei Date: Sun, 15 Apr 2018 13:15:18 -0400 Subject: fsp_srv: Implement DeleteFile. - Used by Binding of Isaac. --- src/core/file_sys/disk_filesystem.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/core/file_sys/disk_filesystem.cpp') 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> Disk_FileSystem::OpenFile(const std:: std::make_unique(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 { -- cgit v1.2.3