follow symbolic links for dirname