bes Updated for version 3.20.13
|
Get a new temporary file. More...
#include <TempFile.h>
Public Member Functions | |
std::string | create (const std::string &dir_name="/tmp/hyrax_tmp", const std::string &path_template="opendap") |
Create a new temporary file. | |
int | get_fd () const |
std::string | get_name () const |
TempFile (bool keep_temps=false) | |
~TempFile () | |
Free the temporary file. | |
Static Public Member Functions | |
static void | sigpipe_handler (int signal) |
Friends | |
class | TemporaryFileTest |
Get a new temporary file.
Get a new temporary file that will be closed and deleted when the instance is deleted (i.e., goes out of scope). The intent of this class is to build temporary files that will be closed/deleted regardless of how the caller exits - regularly or via an exception.
Definition at line 46 of file TempFile.h.
|
explicit |
keep_temps | Keep the temporary files. |
Definition at line 154 of file TempFile.cc.
bes::TempFile::~TempFile | ( | ) |
Free the temporary file.
Close the open descriptor and delete (unlink) the file name.
Definition at line 235 of file TempFile.cc.
string bes::TempFile::create | ( | const std::string & | dir_name = "/tmp/hyrax_tmp" , |
const std::string & | temp_file_prefix = "opendap" |
||
) |
Create a new temporary file.
Get a new temporary file using the given directory and temporary file prefix. If the directory does not exist it will be created.
dir_name | The name of the directory in which the temporary file will be created. |
temp_file_prefix | A prefix to be used for the temporary file. |
Definition at line 170 of file TempFile.cc.
|
inline |
Definition at line 77 of file TempFile.h.
|
inline |
Definition at line 80 of file TempFile.h.
|
static |
We need to make sure that all of the open temporary files get cleaned up if bad things happen. So far, SIGPIPE is the only bad thing we know about at least with respect to the TempFile class.
Definition at line 67 of file TempFile.cc.
|
friend |
Definition at line 64 of file TempFile.h.