Skip to content
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 more options than "if_newer" to fs.copy #458

Closed
atollk opened this issue Mar 19, 2021 · 0 comments · Fixed by #460
Closed

Add more options than "if_newer" to fs.copy #458

atollk opened this issue Mar 19, 2021 · 0 comments · Fixed by #460

Comments

@atollk
Copy link
Member

atollk commented Mar 19, 2021

fs.copy offers free functions to copy a file system / directory / single file only if the source is newer than the destination. Those functions are marked by the _if_newer suffix.

I propose to add instead variants with just an _if suffix that take a strategy: str parameter to distinguish between different conditional cases rather than having to add three new _if_X functions. In particular, it would make supporting the following three strategies in addition to "if_newer" easy:

  • Only copy if the source is older than the destination.
  • Only copy if the destination does not exist.
  • Only copy if the destination already exists.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants