check whether something is a path