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

mv to different parent folder #50

Closed
jkrumbiegel opened this issue Mar 12, 2021 · 2 comments
Closed

mv to different parent folder #50

jkrumbiegel opened this issue Mar 12, 2021 · 2 comments

Comments

@jkrumbiegel
Copy link

I have a tree structure in one folder, want to process files and then store basically the same folder structure with the processed files in a different place. I couldn't figure out how to do that with mv because it seems the regex only matches from the first subfolder down. I'm sure I'm just misunderstanding something, so I'd appreciate any advice

@shashi
Copy link
Owner

shashi commented Mar 12, 2021

Oooh! mv is a lazy move of contents within a tree...

You can use save along with rename to actually write your new tree to a dir.

save(rename(tree, "new_dir")) do f
   ... define how to save a single file f ...
end

This is a basic operation, should probably be more clearly documented...

@jkrumbiegel
Copy link
Author

Aha thanks, see I figured that shouldn't be so hard :) I completely missed rename, but probably because I was not thinking about "names" and it was not used in any of the examples I saw. The saving example uses a much fancier renaming scheme, maybe an additional simpler example for saving could also help here.

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

No branches or pull requests

2 participants