From 62cad71a1a36aabc550362d8fa4a61752076f7c9 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 5 Jul 2022 21:05:30 -0400 Subject: Fix lilv_is_directory() in MinGW --- src/filesystem.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/filesystem.c b/src/filesystem.c index 307bda6..2785cca 100644 --- a/src/filesystem.c +++ b/src/filesystem.c @@ -310,8 +310,15 @@ lilv_path_exists(const char* path) bool lilv_is_directory(const char* path) { +#if defined(_WIN32) + const DWORD attrs = GetFileAttributes(path); + + return (attrs != INVALID_FILE_ATTRIBUTES) && + (attrs & FILE_ATTRIBUTE_DIRECTORY); +#else struct stat st; return !stat(path, &st) && S_ISDIR(st.st_mode); +#endif } int -- cgit v1.2.1