Tomas Carnecky writes:
> #if defined(__sun__)
>       ... sprintf, stat etc
> #else
>       (void) path;
>       return dirent->d_type == DT_DIR;
> #endif

Rather than a platform-specific check, it would be better to check if DT_DIR
is defined.

Beware that even on Linux (where the d_type field is present), it may always
contain DT_UNKNOWN for some filesystems, so you really should check for that
case and fall back to using stat() instead.

Cheers,
    Olly

Reply via email to