Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/libutil/filesystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,15 @@ Filesystem::path_is_absolute(string_view path, bool dot_is_absolute)
bool
Filesystem::exists(string_view path) noexcept
{
#ifdef _WIN32
// filesystem::exists is slow on Windows for network paths, so use the
// WinAPI directly
return INVALID_FILE_ATTRIBUTES
!= GetFileAttributesW(Strutil::utf8_to_utf16wstring(path).c_str());
#else
error_code ec;
return filesystem::exists(u8path(path), ec);
#endif
}


Expand Down
Loading