Throw RuntimeException is scandir returns false.