-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add copy and copytree methods #108
Comments
Hello, I was building a library for the same purpose, and I discovered this very nice one. I would like to contribute; is it ok if I pick this one up? |
Yes! Thank you for your interest and the offer to contribute! Let us know if you have any questions. |
That @genziano, that would be awesome. Just as a heads up, I think we may need two code paths: (1) that uses the (2) that can work across cloud providers. This will likely need to do a download then upload and transit through the machine running cloudpathlib code. Also, there are few notes in the issue about contributing that may be useful while we haven't done full contributor instructions yet: |
Great, I will work on it! And thanks for the tips. I have one initial question: to which object should the methods |
IMO on p1 = CloudPath("s3://b/file1.txt")
# copies the file from p1 to the passed path
p2 = p1.copy(CloudPath("s3://b/file2.txt"))
# str destination passes through to instantiation using the CloudPath factory on p1
p2 = p1.copy("s3://b/file2.txt")
# dir destination copies and keeps filename
p2 = p1.copy(CloudPath("s3://b/folder/"))
# copy on a dir raises error to use copytree if src is not a file
CloudPath("s3://b/folder/").copy("s3://b/folder2")
# copies the entire directory from folder1 to folder2
CloudPath("s3://b/folder/").copytree("s3://b/folder2") |
would be nice to have this feature, is there a plan for releasing? |
We should have
copy
andcopytree
methods for copying from one cloud path to another, similar to how shutil's functions work.The text was updated successfully, but these errors were encountered: