use withSystemTempFile for temporary files