Adds supports for relative path setting in `path_tempfile`

and also auto-creation of temp directory if necessary.