Skip to content
Snippets Groups Projects
Commit 067f6154 authored by Thomas Müller's avatar Thomas Müller
Browse files

Path: allow deleting directories

parent ef625cd5
No related branches found
No related tags found
No related merge requests found
...@@ -321,11 +321,15 @@ public: ...@@ -321,11 +321,15 @@ public:
return os; return os;
} }
bool remove_file() { bool remove_file() const {
#if !defined(_WIN32) #if !defined(_WIN32)
return std::remove(str().c_str()) == 0; return std::remove(str().c_str()) == 0;
#else #else
return DeleteFileW(wstr().c_str()) != 0; if (is_directory()) {
return RemoveDirectoryW(wstr().c_str()) != 0;
} else {
return DeleteFileW(wstr().c_str()) != 0;
}
#endif #endif
} }
......
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