``` >>> from pathlib import Path >>> d = Path('/tmp/wat') >>> d.mkdir(exist_ok=True, parents=True) >>> import tempfile >>> with tempfile.NamedTemporaryFile(dir=d) as f: ... print(f.name) ... /tmp/wat/tmp68qwo9yy ```