Use DirEntry instead of deprecated dirEntry