Get rid of redundant readdir command.