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

wishlist: support for recursive 'copy' support #207

Open
karenetheridge opened this issue Apr 21, 2018 · 3 comments
Open

wishlist: support for recursive 'copy' support #207

karenetheridge opened this issue Apr 21, 2018 · 3 comments
Labels

Comments

@karenetheridge
Copy link
Contributor

Currently, calling $path->copy on a directory results in: copy failed for ... to ...: Is a directory. It would be great to have support for copying directories, as a number of high-river distributions are using a module to do this that may not be suitable for such a high river position.

Possibly File::Copy::Recursive::Reduced could be used for this. There may be alternatives.

@karenetheridge
Copy link
Contributor Author

I think we should seriously consider writing our own, or putting such functionality into File::Copy. It may be as simple as: use File::Path::mktree to create the directory structure; walk the tree and copy (using File::Copy::copy?) each file from src to dest.

(File::Copy::Recursive uses Path::Tiny (although it really shouldn't), so we simply cannot just use FCR in Path::Tiny to get this functionality.)

@xdg
Copy link
Contributor

xdg commented Apr 21, 2018

This is related to #58 and #22. Directory copies also need to consider a follow_symlinks option. Possibly, in the case of a directory we use the iterator method. As that is breadth first, there's an opportunity to create directories as we go before getting to their children.

@xdg xdg added the wishlist label Oct 30, 2022
@ap
Copy link
Contributor

ap commented Feb 27, 2023

This was also posted over at RT as #146593.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants