Skip to content

Commit 925cc7e

Browse files
brycehutchingsrpavlik
authored andcommitted
address feedback
1 parent 0f32825 commit 925cc7e

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/common/filesystem_utils.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,10 @@ bool FileSysUtilsFindFilesInPath(const std::string& path, std::vector<std::strin
152152

153153
#elif defined(XR_OS_WINDOWS)
154154

155-
bool FileSysUtilsIsRegularFile(const std::string& path) { return !FileSysUtilsIsDirectory(path); }
155+
bool FileSysUtilsIsRegularFile(const std::string& path) {
156+
const DWORD attr = GetFileAttributesW(utf8_to_wide(path).c_str());
157+
return attr != INVALID_FILE_ATTRIBUTES && !(attr & FILE_ATTRIBUTE_DIRECTORY);
158+
}
156159

157160
bool FileSysUtilsIsDirectory(const std::string& path) {
158161
const DWORD attr = GetFileAttributesW(utf8_to_wide(path).c_str());

0 commit comments

Comments
 (0)