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
Skip existing files in file_copy(overwrite = FALSE) #213
Comments
Allowing this would complicate the API for limited benefit`.
However we could possibly add a |
I assumed there was a good reason for the current behavior. The option that
you suggest would solve my problem, I think. Thanks for the explanation and
suggestion!
…On Mon, Aug 12, 2019 at 5:36 AM Jim Hester ***@***.***> wrote:
Allowing this would complicate the API for limited benefit`.
file.copy() not failing when files exist has caused numerous
unintentional bugs, avoiding this is one of the reasons the fs package
exists.
However we could possibly add a fail argument like now exists for dir_ls(),
which would issue a warning instead of failing if a file exists.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#213?email_source=notifications&email_token=AARG62U4YXVGMQVYUDMHTW3QEFKLZA5CNFSM4IK55632YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4CMPQY#issuecomment-520406979>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AARG62TLORNFLC7NA2KDNRTQEFKLZANCNFSM4IK5563Q>
.
|
I think this functionality would be really useful. Though I agree it should not be the default. Either a fail argument, or for example, allow overwrite to take Is there a reason this was never implemented? |
FWIW (macos) It does seem like an anti-pattern, because after running
you cannot be sure that source and target are the same, and this makes reasoning hard. If the goal is to make |
My primary need for the skipping is precisely because I'm copying from a very slow filesystem to my local machine. I don't think that the risk of files not being the same means it shouldn't be an option to skip, especially if it's not the default. I think it's ok to put some burden on the end-user. This could be even more explicit if there were a couple options, eg:
|
skip_info would be a great option! |
@vorpalvorpal Instead of copying the files locally to avoid dealing with the slow server, I ended up writing a I still think it would be useful to enable a "mirror tree" functionality, though. Perhaps it just warrants a new |
Is there a reason why
file_copy(overwrite = FALSE)
must throw an error when a file already exists? Is it possible to allow the function to only copy files that don't exist, similar tofile.copy(overwrite = FALSE)
? Thanks for considering.The text was updated successfully, but these errors were encountered: