#include <system.hh>
Public Member Functions | |
FILE * | detach () |
FILE * | handle () const |
boost::filesystem::path | path () const |
tempfile () | |
tempfile (std::string const &basename) | |
~tempfile () | |
Static Public Member Functions | |
static FILE * | create () |
static FILE * | mkstemp (std::string const &base, boost::filesystem::path &path) |
Private Attributes | |
auto_close | m_guard |
boost::filesystem::path | m_path |
A temporary file. It is created on construction and removed on destruction
Create a temporary file. If you use this constructor, you cannot have the file name. You'll have to use only the file handle.
unix_error |
tempfile::tempfile | ( | std::string const & | basename | ) |
Create a temporary file using a base name The file name is available using path()
The tempfile() version is more secure. Use only this constructor if you need the file path
FILE * tempfile::create | ( | ) | [static] |
Creates a temporary file
unix_error | an error occured |
FILE * tempfile::detach | ( | ) |
FILE * tempfile::handle | ( | ) | const |
FILE * tempfile::mkstemp | ( | std::string const & | base, |
boost::filesystem::path & | path | ||
) | [static] |
boost::filesystem::path tempfile::path | ( | ) | const |
auto_close utilmm::tempfile::m_guard [private] |
boost::filesystem::path utilmm::tempfile::m_path [private] |