diff options
| author | bunnei <bunneidev@gmail.com> | 2018-04-15 15:13:02 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-04-15 15:13:02 -0400 |
| commit | b8825fbf10c3122309313a959a93b20baa94ec2f (patch) | |
| tree | c7e6223749099a7ae145cb1a925d6a71c16c169a /src/core/file_sys/disk_filesystem.cpp | |
| parent | b60834ac41ea3fcff26cf19cd08f2dbe3f3bda58 (diff) | |
| parent | bddad50dd400b31849fbd9486637fa9a2522cf58 (diff) | |
Merge pull request #335 from bunnei/delete-file
fsp_srv: Implement DeleteFile.
Diffstat (limited to 'src/core/file_sys/disk_filesystem.cpp')
| -rw-r--r-- | src/core/file_sys/disk_filesystem.cpp | 12 |
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 { |
