utilmm::tempfile Class Reference
[OS-related tools]
#include <system.hh>
List of all members.
Detailed Description
A temporary file. It is created on construction and removed on destruction
Definition at line 89 of file system.hh.
Constructor & Destructor Documentation
Create a temporary file. If you use this constructor, you cannot have the file name. You'll have to use only the file handle.
- Exceptions:
-
Definition at line 127 of file system.cc.
Close and destroy the file
Definition at line 130 of file system.cc.
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
Definition at line 120 of file system.cc.
Member Function Documentation
FILE * tempfile::create |
( |
|
) |
[static] |
Creates a temporary file
- Returns:
- the file descriptor to the open file
- Exceptions:
-
Definition at line 94 of file system.cc.
FILE * tempfile::detach |
( |
|
) |
|
Disassociates this object from the temporary file After a call to disassociate(), path() and fd() are no longer available
- Returns:
- the file path
Definition at line 147 of file system.cc.
FILE * tempfile::handle |
( |
void |
|
) |
const |
Get the underlying file handle
Definition at line 141 of file system.cc.
FILE * tempfile::mkstemp |
( |
std::string const & |
base, |
|
|
boost::filesystem::path & |
path | |
|
) |
| | [static] |
Wrapper around mkstemp Do not use this function to create a temporary file Use a tempfile object instead
Definition at line 102 of file system.cc.
boost::filesystem::path tempfile::path |
( |
|
) |
const |
Get the file path The file path is only available if the tempfile(std::string)
constructor has been used.
- Returns:
- the file path or an empty path if it is not available
Definition at line 155 of file system.cc.
Member Data Documentation
The documentation for this class was generated from the following files: