summaryrefslogtreecommitdiffstats
path: root/src/core/file_sys/disk_filesystem.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/core/file_sys/disk_filesystem.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/core/file_sys/disk_filesystem.cpp b/src/core/file_sys/disk_filesystem.cpp
index 4235f3935..ca1323873 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 {
@@ -179,7 +183,7 @@ bool Disk_Storage::SetSize(const u64 size) const {
return true;
}
-Disk_Directory::Disk_Directory(const std::string& path) : directory() {
+Disk_Directory::Disk_Directory(const std::string& path) {
unsigned size = FileUtil::ScanDirectoryTree(path, directory);
directory.size = size;
directory.isDirectory = true;