|
libwreport
3.5
|
open(2) file descriptors More...
#include <sys.h>
Public Member Functions | |
| File (File &&)=default | |
| File (const File &)=delete | |
| File (const std::string &pathname, int flags, mode_t mode=0777) | |
| Wrapper around open(2) | |
| ~File () | |
| The destructor closes the file descriptor, but does not check errors on ::close(). More... | |
| File & | operator= (const File &)=delete |
| File & | operator= (File &&)=default |
Public Member Functions inherited from wreport::sys::NamedFileDescriptor | |
| NamedFileDescriptor (int fd, const std::string &pathname) | |
| NamedFileDescriptor (NamedFileDescriptor &&) | |
| NamedFileDescriptor & | operator= (NamedFileDescriptor &&) |
| virtual void | throw_error (const char *desc) |
| Throw an exception based on errno and the given message. More... | |
| const std::string & | name () const |
| Return the file pathname. | |
Public Member Functions inherited from wreport::sys::FileDescriptor | |
| FileDescriptor (FileDescriptor &&o) | |
| FileDescriptor (int fd) | |
| void | close () |
| void | fstat (struct stat &st) |
| void | fchmod (mode_t mode) |
| size_t | write (const void *buf, size_t count) |
| void | write_all (const void *buf, size_t count) |
| Write all the data in buf, retrying partial writes. | |
| MMap | mmap (size_t length, int prot, int flags, off_t offset=0) |
| operator int () const | |
Static Public Member Functions | |
| static File | mkstemp (const std::string &prefix) |
Additional Inherited Members | |
Protected Attributes inherited from wreport::sys::NamedFileDescriptor | |
| std::string | pathname |
Protected Attributes inherited from wreport::sys::FileDescriptor | |
| int | fd = -1 |
open(2) file descriptors
| wreport::sys::File::~File | ( | ) |
The destructor closes the file descriptor, but does not check errors on ::close().
In normal program flow, it is a good idea to explicitly call File::close() in places where it can throw safely.
1.8.9.1