handle relative and ~parrt paths.