-// Copyright 2005 Ben Hutchings <ben@decadentplace.org.uk>.
+// Copyright 2005 Ben Hutchings <ben@decadent.org.uk>.
// See the file "COPYING" for licence details.
#include "temp_file.hpp"
{
close();
- // Don't assert that this is successful. The file could have
- // been removed by another process.
- unlink(name_.c_str());
+ if (!keep_)
+ {
+ // Don't assert that this is successful. The file could have
+ // been removed by another process.
+ unlink(name_.c_str());
+ }
}
void temp_file::close()
fd_ = -1;
}
}
+
+bool temp_file::keep_ = false;
+
+void temp_file::keep_all(bool keep)
+{
+ keep_ = keep;
+}