wouldn't this cause problems if any method after it used relative paths? maybe chdir into .tmpdir() instead?