diff options
Diffstat (limited to 'lib/System/Win32/Path.inc')
-rw-r--r-- | lib/System/Win32/Path.inc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/System/Win32/Path.inc b/lib/System/Win32/Path.inc index 46b965f..573369e 100644 --- a/lib/System/Win32/Path.inc +++ b/lib/System/Win32/Path.inc @@ -608,7 +608,8 @@ Path::createDirectoryOnDisk(bool create_parents, std::string* ErrMsg) { while (*next) { next = strchr(next, '/'); *next = 0; - if (!CreateDirectory(pathname, NULL)) + if (!CreateDirectory(pathname, NULL) && + GetLastError() != ERROR_ALREADY_EXISTS) return MakeErrMsg(ErrMsg, std::string(pathname) + ": Can't create directory: "); *next++ = '/'; @@ -616,7 +617,8 @@ Path::createDirectoryOnDisk(bool create_parents, std::string* ErrMsg) { } else { // Drop trailing slash. pathname[len-1] = 0; - if (!CreateDirectory(pathname, NULL)) { + if (!CreateDirectory(pathname, NULL) && + GetLastError() != ERROR_ALREADY_EXISTS) { return MakeErrMsg(ErrMsg, std::string(pathname) + ": Can't create directory: "); } } |