public function __construct($prefix, $suffix = ".tmp")
{
$tries = 0;
$omask = umask(077);
do {
$path = new Tempname($prefix, $suffix);
$this->handle = fopen($path, "x");
} while (!is_resource($this->handle) && $tries++ < 10);
umask($omask);
if (!is_resource($this->handle)) {
throw new Exception("Could not create temporary file");
}
parent::__construct($path);
}