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