Added read_dir() function