Elaboradar 0.1
|
Open a temporary directory. Continua...
#include <sys.h>
Membri pubblici | |
void | rmtree_on_exit (bool val) |
Change the rmtree-on-exit behaviour. | |
![]() | |
Path (const char *pathname, int flags=0, mode_t mode=0777) | |
Open the given pathname with flags | O_PATH. | |
Path (const std::string &pathname, int flags=0, mode_t mode=0777) | |
Open the given pathname with flags | O_PATH. | |
Path (Path &parent, const char *pathname, int flags=0, mode_t mode=0777) | |
Open the given pathname calling parent.openat, with flags | O_PATH. | |
void | open (int flags, mode_t mode=0777) |
Wrapper around open(2) with flags | O_PATH. | |
iterator | begin () |
Begin iterator on all directory entries. | |
iterator | end () |
End iterator on all directory entries. | |
int | openat_ifexists (const char *pathname, int flags, mode_t mode=0777) |
Same as openat, but returns -1 if the file does not exist. | |
bool | fstatat_ifexists (const char *pathname, struct stat &st) |
fstatat, but in case of ENOENT returns false instead of throwing | |
void | lstatat (const char *pathname, struct stat &st) |
fstatat with the AT_SYMLINK_NOFOLLOW flag set | |
bool | lstatat_ifexists (const char *pathname, struct stat &st) |
lstatat, but in case of ENOENT returns false instead of throwing | |
void | rmdirat (const char *pathname) |
unlinkat with the AT_REMOVEDIR flag set | |
void | rmtree () |
Delete the directory pointed to by this Path, with all its contents. | |
![]() | |
~ManagedNamedFileDescriptor () | |
The destructor closes the file descriptor, but does not check errors on close(). | |
![]() | |
virtual void | throw_error (const char *desc) |
Throw an exception based on errno and the given message. | |
virtual void | throw_runtime_error (const char *desc) |
Throw a runtime_error unrelated from errno. | |
const std::string & | name () const |
Return the file pathname. | |
![]() | |
bool | is_open () const |
Check if the file descriptor is open (that is, if it is not -1) | |
void | close () |
Close the file descriptor, setting its value to -1. | |
bool | read_all_or_retry (void *buf, size_t count) |
Read count bytes into bufr, retrying partial reads, stopping at EOF. | |
void | read_all_or_throw (void *buf, size_t count) |
Read all the data into buf, throwing runtime_error in case of a partial read. | |
void | write_all_or_retry (const void *buf, size_t count) |
Write all the data in buf, retrying partial writes. | |
void | write_all_or_throw (const void *buf, size_t count) |
Write all the data in buf, throwing runtime_error in case of a partial write. | |
bool | ofd_setlk (struct ::flock &) |
Open file description locks F_OFD_SETLK operation. | |
bool | ofd_setlkw (struct ::flock &, bool retry_on_signal=true) |
Open file description locks F_OFD_SETLKW operation. | |
bool | ofd_getlk (struct ::flock &) |
Open file description locks F_OFD_GETLK operation. | |
int | getfl () |
Get open flags for the file. | |
void | setfl (int flags) |
Set open flags for the file. | |
Open a temporary directory.
By default, the temporary directory will be deleted when the object is deleted.