Fix relative path to current directory being empty case for windows file system CreateDir function.

PiperOrigin-RevId: 223405610
This commit is contained in:
Gunhan Gulsoy 2018-11-29 13:54:40 -08:00 committed by TensorFlower Gardener
parent 94008f8c57
commit 7e70dc4317

View File

@ -439,6 +439,9 @@ Status WindowsFileSystem::DeleteFile(const string& fname) {
Status WindowsFileSystem::CreateDir(const string& name) {
Status result;
std::wstring ws_name = Utf8ToWideChar(name);
if (ws_name.empty()) {
return errors::AlreadyExists(name);
}
if (_wmkdir(ws_name.c_str()) != 0) {
result = IOError("Failed to create a directory: " + name, errno);
}