guess whether the path is a directory