I am iterating directories recursively with readdir.
struct dirent is documented here, and notes that d_type can have different values including DT_LNK and DT_DIR and DT_REG.
However, when d_type is DT_LNK, there is no hint about whether the link is to a file or directory.
Is there a a way to check whether the target of a symlink is a file or directory?