Use mkdtemp() for testing