check for the valid pathname (if it is a DIR)