Skip to content
Snippets Groups Projects
Unverified Commit fd1f5c54 authored by bunnei's avatar bunnei Committed by GitHub
Browse files

Merge pull request #662 from Subv/delete_file

FileSys: Append the requested path to the filesystem base path in DeleteFile
parents ad0166a9 7e5e4f8d
No related branches found
No related tags found
No related merge requests found
...@@ -58,11 +58,13 @@ ResultVal<std::unique_ptr<StorageBackend>> Disk_FileSystem::OpenFile(const std:: ...@@ -58,11 +58,13 @@ ResultVal<std::unique_ptr<StorageBackend>> Disk_FileSystem::OpenFile(const std::
} }
ResultCode Disk_FileSystem::DeleteFile(const std::string& path) const { ResultCode Disk_FileSystem::DeleteFile(const std::string& path) const {
if (!FileUtil::Exists(path)) { std::string full_path = base_directory + path;
if (!FileUtil::Exists(full_path)) {
return ERROR_PATH_NOT_FOUND; return ERROR_PATH_NOT_FOUND;
} }
FileUtil::Delete(path); FileUtil::Delete(full_path);
return RESULT_SUCCESS; return RESULT_SUCCESS;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment