summaryrefslogtreecommitdiffstats
path: root/src/filesystem.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/filesystem.c')
-rw-r--r--src/filesystem.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/filesystem.c b/src/filesystem.c
index 4ba0bd9..dc72d93 100644
--- a/src/filesystem.c
+++ b/src/filesystem.c
@@ -32,6 +32,7 @@
# include <io.h>
# define F_OK 0
# define mkdir(path, flags) _mkdir(path)
+# define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
#else
# include <dirent.h>
# include <unistd.h>
@@ -240,6 +241,13 @@ lilv_path_exists(const char* path)
#endif
}
+bool
+lilv_is_directory(const char* path)
+{
+ struct stat st;
+ return !stat(path, &st) && S_ISDIR(st.st_mode);
+}
+
int
lilv_copy_file(const char* src, const char* dst)
{