Use stat when listing files so that link to directories are handled as directories