summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/filesystem.c7
1 files changed, 7 insertions, 0 deletions
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