This patch adds FileUtils.ln_r (recursive hard link). It is patterned after #cp_r and I have used it in an app of mine, and thus far it has worked fine.
The only thing about it that I am not 100% sure, is it's handling of non-file and non-directory file types. I just assumed any other type other than a directory can be hard linked.
Also I made a note about using --remove-destination vs. --force I'm not sure why one would be used over the other. #ln uses --force while #cp_r uses --remove-destination. I went with the later.
change cp to ln
"The only thing about it that I am not 100% sure, is it's handling of non-file and non-directory file types. "
'its' not 'it's' ;)
Hi, can you post it to our redmine? As this is a new feature matz's approval is required. Once that's made it's OK for me to pull it into the mainstream. Thank you.
(remember to set the tracker as "feature")
Having a convenience function to recursively create hard links based on a source directory is a rare need, but a need, nonetheless. I think FileUtils is a fine place for it when compared to the other choices of where to place it in Ruby core.
Closing this as there is already an open ticket on redmine