Fix #267, readdir on file path should error