URING++
|
An opened directory. More...
#include <uringpp/dir.h>
Public Member Functions | |
int | fd () const |
Get the file descriptor of the directory. More... | |
dir (std::shared_ptr< event_loop > loop, int fd) | |
Construct a new dir object from a file descriptor. More... | |
dir (dir &&other) noexcept | |
Move construct a new dir object. More... | |
~dir () | |
Destroy the dir object. If the directory is open, it will be closed. More... | |
task< void > | close () |
Close the directory. More... | |
sqe_awaitable | statx (const char *path, int flags, unsigned mask, struct statx *statxbuf) |
Stat a file/directory in the directory. More... | |
sqe_awaitable | mkdir (const char *path, mode_t mode) |
Make a directory. More... | |
sqe_awaitable | symlink (const char *oldpath, const char *newpath) |
Symbolic link a file/directory in the directory. More... | |
sqe_awaitable | symlink (const char *oldpath, dir const &newdir, const char *newpath) |
Symbolic link a file/directory in the directory to another directory. More... | |
sqe_awaitable | link (const char *oldpath, const char *newpath, int flags) |
Link a file/directory in the directory. More... | |
sqe_awaitable | link (const char *oldpath, dir const &newdir, const char *newpath, int flags) |
Link a file/directory in the directory to another directory. More... | |
sqe_awaitable | rename (const char *oldpath, const char *newpath, int flags) |
Rename a file/directory in the directory. More... | |
sqe_awaitable | rename (const char *oldpath, dir const &newdir, const char *newpath, int flags) |
Rename a file/directory in the directory to another directory. More... | |
sqe_awaitable | unlink (const char *path, int flags) |
Unlink a file/directory in the directory. More... | |
![]() | |
noncopyable (noncopyable &&)=default | |
noncopyable (noncopyable const &)=delete | |
noncopyable & | operator= (noncopyable const &)=delete |
noncopyable & | operator= (noncopyable &&)=default |
Static Public Member Functions | |
static task< dir > | open (std::shared_ptr< event_loop > loop, char const *path, int flags, mode_t mode) |
Open a directory in the current working directory. More... | |
static task< dir > | openat (std::shared_ptr< event_loop > loop, dir const &dir, char const *path, int flags, mode_t mode) |
Open a directory in the given directory. More... | |
static task< dir > | openat2 (std::shared_ptr< event_loop > loop, dir const &dir, char const *path, struct open_how *how) |
Open a directory in the given directory. More... | |
Protected Attributes | |
std::shared_ptr< event_loop > | loop_ |
int | fd_ |
An opened directory.
|
inline |
Construct a new dir object from a file descriptor.
loop | The event loop. |
fd | The file descriptor. |
|
inlinenoexcept |
Move construct a new dir object.
other |
|
inline |
Destroy the dir object. If the directory is open, it will be closed.
|
inline |
Close the directory.
|
inline |
Get the file descriptor of the directory.
|
inline |
Link a file/directory in the directory.
oldpath | The path to the file/directory to link. |
newpath | The path to the file/directory to link to. |
flags | The flags to use when linking the file/directory. |
|
inline |
Link a file/directory in the directory to another directory.
oldpath | The path to the file/directory to link. |
newdir | The directory to link to. |
newpath | The path to the file/directory to link to. |
flags | The flags to use when linking the file/directory. |
|
inline |
Make a directory.
path | The path to the directory. |
mode | The mode to use when making the directory. |
|
inlinestatic |
Open a directory in the current working directory.
loop | The event loop. |
path | The path to the directory. |
flags | The flags to use when opening the directory. |
mode | The mode to use when opening the directory. |
|
inlinestatic |
Open a directory in the given directory.
loop | The event loop. |
dir | The directory to open the directory in. |
path | The path to the directory. |
flags | The flags to use when opening the directory. |
mode | The mode to use when opening the directory. |
|
inlinestatic |
Open a directory in the given directory.
loop | The event loop. |
dir | The directory to open the directory in. |
path | The path to the directory. |
how | How to open the directory. |
|
inline |
Rename a file/directory in the directory.
oldpath | The path to the file/directory to rename. |
newpath | The path to the file/directory to rename to. |
flags | The flags to use when renaming the file/directory. |
|
inline |
Rename a file/directory in the directory to another directory.
oldpath | The path to the file/directory to rename. |
newdir | The directory to rename to. |
newpath | The path to the file/directory to rename to. |
flags | The flags to use when renaming the file/directory. |
|
inline |
Stat a file/directory in the directory.
path | The path to the file/directory. |
flags | The flags to use when statting the file/directory. |
mask | The mask to use when statting the file/directory. |
statxbuf | The statxbuf to use when statting the file/directory. |
|
inline |
Symbolic link a file/directory in the directory.
oldpath | The path to the file/directory to link. |
newpath | The path to the file/directory to link to. |
|
inline |
Symbolic link a file/directory in the directory to another directory.
oldpath | The path to the file/directory to link. |
newdir | The directory to link to. |
newpath | The path to the file/directory to link to. |
|
inline |
Unlink a file/directory in the directory.
path | The path to the file/directory to unlink. |
flags | The flags to use when unlink the file/directory. |