This could be <b>really</b> dangerous if for some accidental reason "tmp_dir" evaluates to "/".  IIRC, there's already a temporary directory you can drop stuff that comes along with test class.  The autotest client and test runner both automatically clean up this directory: <code>test.tmpdir</code>