[util] (TFsPath::MkDir) don't fail in case of EEXIST
@@ -301,10 +301,16 @@ void TFsPath::MkDir(const int mode) const {
CheckDefined();
if (!Exists()) {
int r = Mkdir(~*this, mode);
- if (r != 0)
+ if (r != 0) {
+ // TODO (stanly) will still fail on Windows because
+ // LastSystemError() returns windows specific ERROR_ALREADY_EXISTS
+ // instead of EEXIST.
+ if (LastSystemError() != EEXIST) {
ythrow TIoSystemError() << "could not create directory " << Path_;
}
}
+ }
+}
void TFsPath::MkDirs(const int mode) const {
CheckDefined();
