1
0

Check if file/folder exists before remove

This commit is contained in:
Scott E. Graves
2017-04-20 14:44:52 -05:00
parent aef21f4db2
commit a3559d56c8

View File

@@ -144,7 +144,7 @@ bool FilePath::CreateDirectory() const
bool FilePath::RemoveDirectory() const bool FilePath::RemoveDirectory() const
{ {
#ifdef _WIN32 #ifdef _WIN32
return ::RemoveDirectory(&_path[0]) ? true : false; return !IsDirectory() || ::RemoveDirectory(&_path[0]) ? true : false;
#else #else
a a
#endif #endif
@@ -153,7 +153,7 @@ bool FilePath::RemoveDirectory() const
bool FilePath::DeleteFile() const bool FilePath::DeleteFile() const
{ {
#ifdef _WIN32 #ifdef _WIN32
return ::DeleteFile(&_path[0]) ? true : false; return !IsFile() || ::DeleteFile(&_path[0]) ? true : false;
#else #else
a a
#endif #endif