read_directory(): further split treat_path()