tempfile are created in the same directory to avoid partition problems