diff options
Diffstat (limited to 'source/Host/windows/FileSystem.cpp')
-rw-r--r-- | source/Host/windows/FileSystem.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/source/Host/windows/FileSystem.cpp b/source/Host/windows/FileSystem.cpp index 9309b89f2baf..3217cdc8480a 100644 --- a/source/Host/windows/FileSystem.cpp +++ b/source/Host/windows/FileSystem.cpp @@ -75,7 +75,7 @@ Status FileSystem::Readlink(const FileSpec &src, FileSpec &dst) { else if (!llvm::convertWideToUTF8(buf.data(), path)) error.SetErrorString(PATH_CONVERSION_ERROR); else - dst.SetFile(path, false, FileSpec::Style::native); + dst.SetFile(path, FileSpec::Style::native); ::CloseHandle(h); return error; @@ -96,3 +96,12 @@ FILE *FileSystem::Fopen(const char *path, const char *mode) { return nullptr; return file; } + +int FileSystem::Open(const char *path, int flags, int mode) { + std::wstring wpath; + if (!llvm::ConvertUTF8toWide(path, wpath)) + return -1; + int result; + ::_wsopen_s(&result, wpath.c_str(), flags, _SH_DENYNO, mode); + return result; +} |