diff --git a/platypush/plugins/file/__init__.py b/platypush/plugins/file/__init__.py index c9670c99b3..81f0885b8c 100644 --- a/platypush/plugins/file/__init__.py +++ b/platypush/plugins/file/__init__.py @@ -154,6 +154,26 @@ class FilePlugin(Plugin): """ pathlib.Path(self._get_path(file)).rename(self._get_path(name)) + @action + def copy(self, source: str, target: str): + """ + Copy a file. + + :param source: Source file. + :param target: Destination file. + """ + shutil.copy(self._get_path(source), self._get_path(target)) + + @action + def move(self, source: str, target: str): + """ + Move a file. + + :param source: Source file. + :param target: Destination file. + """ + shutil.move(self._get_path(source), self._get_path(target)) + @action def link(self, file: str, target: str, symbolic=True): """