diff options
Diffstat (limited to 'src/posix_extras.h')
-rw-r--r-- | src/posix_extras.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/posix_extras.h b/src/posix_extras.h index f92bff7..41117f2 100644 --- a/src/posix_extras.h +++ b/src/posix_extras.h @@ -69,8 +69,12 @@ class File { // indeed be relative (i.e., it must not start with '/'). struct stat LinkStatAt(const char* path) const; - // Creates a file or directory at the path relative to the file descriptor. - // The path must indeed be relative (i.e., it must not start with '/'). + // Creates a directory at the path relative to the file descriptor. The path + // must indeed be relative (i.e., it must not start with '/'). + void MkDir(const char* path, mode_t mode) const; + + // Creates a file at the path relative to the file descriptor. The path must + // indeed be relative (i.e., it must not start with '/'). void MkNod(const char* path, mode_t mode, dev_t dev) const; // Calls openat(2) on the path relative to the file descriptor. The path must @@ -85,6 +89,10 @@ class File { // fewer bytes are returned. std::vector<std::uint8_t> Read(off_t, size_t) const; + // Removes the directory at the path relative to the file descriptor. The + // path must indeed be relative (i.e., it must not start with '/'). + void RmDirAt(const char* path) const; + // Removes the file at the path relative to the file descriptor. The path // must indeed be relative (i.e., it must not start with '/'). void UnlinkAt(const char* path) const; |