diff options
author | Benjamin Barenblat <bbaren@mit.edu> | 2016-02-21 20:19:12 -0500 |
---|---|---|
committer | Benjamin Barenblat <bbaren@mit.edu> | 2016-02-21 20:38:12 -0500 |
commit | 4f9c17ee5044c68a358a92e90772eea5b3966e3c (patch) | |
tree | b98cd677b7ba7b0b7d010ebe0e2797afc74f7d09 /src/posix_extras.h | |
parent | 90c61f66909affa269dfb396f0e5cc67f4e4de44 (diff) |
Implement rename
Diffstat (limited to 'src/posix_extras.h')
-rw-r--r-- | src/posix_extras.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/posix_extras.h b/src/posix_extras.h index 41117f2..b9e9da6 100644 --- a/src/posix_extras.h +++ b/src/posix_extras.h @@ -89,6 +89,11 @@ class File { // fewer bytes are returned. std::vector<std::uint8_t> Read(off_t, size_t) const; + // Renames a file from old_path to new_path. Both paths are interpreted + // relative to the file descriptor, and both must indeed be relative (i.e., + // they must not start with '/'). + void RenameAt(const char* old_path, const char* new_path) 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; |