Check if file/folder exists before remove
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user