dav_tools.files¶
File operations.
Functions¶
|
Copy a file from the source path to the destination path, with an option to create a symlink. |
|
Delete a file at the given path. |
Module Contents¶
- dav_tools.files.copy_file(src_path, dest_path, *, symlink=False)¶
Copy a file from the source path to the destination path, with an option to create a symlink.
- Parameters:
src_path (str) – the path of the source file to be copied
dest_path (str) – the path where the file should be copied
symlink (bool) – if True, a symlink is created at the destination instead of copying the file (default is False)
- Raises:
Exception – if the source path is not a valid file
- Returns:
None
- Return type:
None
- dav_tools.files.delete_file(path)¶
Delete a file at the given path.
- Parameters:
path (str) – the path of the file to be deleted
- Raises:
Exception – if the path is not a valid file
- Returns:
whether the file was deleted or not
- Return type:
bool