Check whether the parent directory exists