![]() |
OpenMS
|
Temporary files that live until the process exits. More...
#include <OpenMS/SYSTEM/TempFiles.h>
Classes | |
| class | Registry_ |
| Holds the allocated filenames and deletes the files at program exit. More... | |
Static Public Member Functions | |
| static std::string | getTemporaryFile (const std::string &alternative_file="") |
| Obtain a temporary filename, ensuring automatic deletion upon exit. | |
Static Private Attributes | |
| static Registry_ | registry_ |
| filenames handed out so far, deleted upon program exit | |
Temporary files that live until the process exits.
Names are allocated below SystemSettings::getTempDirectory() and every file that still exists at exit is removed.
|
static |
Obtain a temporary filename, ensuring automatic deletion upon exit.
The file is not actually created and only deleted at exit if it exists.
However, if 'alternative_file' is given and not empty, no temporary filename is created and 'alternative_file' is returned (and not destroyed upon exit). This is useful if you have an optional output file, which may, or may not be requested, but you need its content regardless, e.g. for intermediate plotting with R. Thus you can just call this function to get a file which can be used and gets automatically destroyed if needed.
| [in] | alternative_file | If this string is not empty, no action is taken and it is used as return value |
|
staticprivate |
filenames handed out so far, deleted upon program exit