diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-11-30 09:56:01 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-11-30 10:05:21 +0300 |
commit | 28d2148b09a2d975876f4418bd5ba15ab5edea8d (patch) | |
tree | 0be71dfc4a7404ec33608958f1ed34c3e7d5914a /source/blender/blenlib/intern/fileops.c | |
parent | fa3d50af95fde76ef08590d2f86444f2f9fdca95 (diff) |
Haiku OS Support
D2860 by @miqlas
Even though Haiku is a niche OS, only minor changes are needed.
Diffstat (limited to 'source/blender/blenlib/intern/fileops.c')
-rw-r--r-- | source/blender/blenlib/intern/fileops.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/source/blender/blenlib/intern/fileops.c b/source/blender/blenlib/intern/fileops.c index 36a0d1c1641..ad53457f863 100644 --- a/source/blender/blenlib/intern/fileops.c +++ b/source/blender/blenlib/intern/fileops.c @@ -621,7 +621,21 @@ static int recursive_operation(const char *startfrom, const char *startto, if (to) join_dirfile_alloc(&to_path, &to_alloc_len, to, dirent->d_name); - if (dirent->d_type == DT_DIR) { + bool is_dir; + +#ifdef __HAIKU__ + { + struct stat st_dir; + char filename[FILE_MAX]; + BLI_path_join(filename, sizeof(filename), startfrom, dirent->d_name, NULL); + lstat(filename, &st_dir); + is_dir = S_ISDIR(st_dir.st_mode); + } +#else + is_dir = (dirent->d_type == DT_DIR); +#endif + + if (is_dir) { /* recursively dig into a subfolder */ ret = recursive_operation(from_path, to_path, callback_dir_pre, callback_file, callback_dir_post); } |