summaryrefslogtreecommitdiff
path: root/src/buildstream/storage/directory.py
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2020-04-22 12:20:16 +0200
committerbst-marge-bot <marge-bot@buildstream.build>2020-04-27 08:32:32 +0000
commit9ce3da0ab8b6a2998b2565864e8234680976f198 (patch)
treecbcc979a58f92a9918e82dd46483ae99040c83bc /src/buildstream/storage/directory.py
parent047549f45ee9670798f2c32822d7429a819964a1 (diff)
downloadbuildstream-9ce3da0ab8b6a2998b2565864e8234680976f198.tar.gz
storage: Add Directory.rename() method
Diffstat (limited to 'src/buildstream/storage/directory.py')
-rw-r--r--src/buildstream/storage/directory.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/buildstream/storage/directory.py b/src/buildstream/storage/directory.py
index 2b3a85be3..f9ea4044a 100644
--- a/src/buildstream/storage/directory.py
+++ b/src/buildstream/storage/directory.py
@@ -306,6 +306,16 @@ class Directory:
"""
raise NotImplementedError()
+ def rename(self, src: List[str], dest: List[str]):
+ """ Rename a file, symlink or directory. If destination path exists
+ already and is a file or empty directory, it will be replaced.
+
+ Args:
+ *src: Source path components.
+ *dest: Destination path components.
+ """
+ raise NotImplementedError()
+
def _create_empty_file(self, *paths):
with self.open_file(*paths, mode="w"):
pass