You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement copy functionality to give Bend the ability to copy files and directories. This should support both single file copying and recursive directory copying.
Implement copy functionality to give Bend the ability to copy files and directories. This should support both single file copying and recursive directory copying.
1.
copy(source, destination, recursive=False, overwrite=False)
Copies a file or directory from the source path to the destination path.
Parameters
source
: Path of the file or directory to be copieddestination
: Path where the file or directory should be copied torecursive
: IfTrue
, copies directories and their contents recursively. Ignored for single copies.overwrite
: IfTrue
, overwrites the destination if it exists. IfFalse
, returns an error if the destination exists.Returns
Ok(None)
if successful, orErr(reason)
if an error occurs.Possible (but not limited to) errors:
FileNotFound
: The source file or directory does not existPermissionDenied
: Lack of permission to read the source or write to the destinationFileExists
: The destination already exists and overwrite isFalse
NotADirectory
: The source is a directory but recursive isFalse
Examples
Considerations
Test cases to implement
The text was updated successfully, but these errors were encountered: