[Bf-committers] error: 'struct dirent' has no member named 'd_type'

Campbell Barton ideasman42 at gmail.com
Sun Jun 10 16:23:11 CEST 2012


Does this help?

http://stackoverflow.com/questions/2197918/cross-platform-way-of-testing-whether-a-file-is-a-directory

If you get it working, sent in a patch

On Sat, Jun 9, 2012 at 1:12 PM, panda kunfu <kunfupanda911 at gmail.com> wrote:
> hi all,
>
> I m getting below error while compiling blender 2.63a on solaris 10 (SPARC)
>
> /data/blender-2.63a/source/blender/blenlib/intern/fileops.c:501:13: error:
> 'struct dirent' has no member named 'd_type'
> /data/blender-2.63a/source/blender/blenlib/intern/fileops.c:501:25: error:
> 'DT_DIR' undeclared (first use in this function)
> /data/blender-2.63a/source/blender/blenlib/intern/fileops.c:501:25: note:
> each undeclared identifier is reported only once for each function it
> appears in
> gmake[2]: ***
> [source/blender/blenlib/CMakeFiles/bf_blenlib.dir/intern/fileops.c.o] Error
> 1
> gmake[1]: *** [source/blender/blenlib/CMakeFiles/bf_blenlib.dir/all] Error 2
> gmake[1]: *** Waiting for unfinished jobs....
>
> the code referred by this error is
>
> ======================================================================================
>  for (i = 0; i < n; i++) {
>                struct dirent *dirent = dirlist[i];
>
>                if (!strcmp(dirent->d_name, ".") || !strcmp(dirent->d_name,
> "..")) {
>                        free(dirent);
>                        continue;
>                }
>
>                join_dirfile_alloc(&from_path, &from_alloc_len, from,
> dirent->d_name);
>
>                if (to)
>                        join_dirfile_alloc(&to_path, &to_alloc_len, to,
> dirent->d_name);
>
>                if (dirent->d_type == DT_DIR) {
>                        /* recursively dig into a folder */
>                        ret = recursive_operation(from_path, to_path,
> callback_dir_pre, callback_file, callback_dir_post);
>                }
>                else if (callback_file) {
>                        /* call file callback for current path */
>                        ret = callback_file(from_path, to_path);
>                        if (ret != recursiveOp_Callback_OK)
>                                ret = -1;
>                }
>
>                if (ret != 0) {
>                        while (i < n)
>                                free(dirlist[i]);
>                        break;
>                }
>        }
> ==================================================================================================================
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers



-- 
- Campbell


More information about the Bf-committers mailing list