#include <streambuf_tmpnam.h>
Inheritance diagram for rpa::filgen_name_to_FILE_base:
Public Member Functions | |
void | open (const char *filNam) |
FILE * | operator() (void) const |
void | close (const char *filNam) |
Private Attributes | |
FILE * | _file |
void rpa::filgen_name_to_FILE_base::close | ( | const char * | filNam | ) |
The file itself is not removed by this class. It is only closed. It is up to the base class to remove it.
void rpa::filgen_name_to_FILE_base::open | ( | const char * | filNam | ) |
There is a security hole because we cannot access this file exclusively. Even if we could, this step cannot be atomic so the file could be by anything, if it is in /tmp. If the file may already be existing. It is not truncated, so the allocated disk space can be reused.
We use the plain standard 'fopen' because the result is and will always be a FILE pointer.
FILE* rpa::filgen_name_to_FILE_base::operator() | ( | void | ) | const [inline] |
It is required that 'const operator()' is called as often as possible, without side effects, and must always return the same value.
FILE* rpa::filgen_name_to_FILE_base::_file [private] |