diff --git a/src/siadrive_api/filepath.cpp b/src/siadrive_api/filepath.cpp index 17a96ce..4e84267 100644 --- a/src/siadrive_api/filepath.cpp +++ b/src/siadrive_api/filepath.cpp @@ -144,7 +144,7 @@ bool FilePath::CreateDirectory() const bool FilePath::RemoveDirectory() const { #ifdef _WIN32 - return ::RemoveDirectory(&_path[0]) ? true : false; + return !IsDirectory() || ::RemoveDirectory(&_path[0]) ? true : false; #else a #endif @@ -153,7 +153,7 @@ bool FilePath::RemoveDirectory() const bool FilePath::DeleteFile() const { #ifdef _WIN32 - return ::DeleteFile(&_path[0]) ? true : false; + return !IsFile() || ::DeleteFile(&_path[0]) ? true : false; #else a #endif