FileUtils.ln_r #4

Closed
wants to merge 2 commits into from

5 participants

@trans

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.

@banister

"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' ;)

@shyouhei
Ruby Programming Language member

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.

http://redmine.ruby-lang.org/projects/ruby-19/issues/new
(remember to set the tracker as "feature")

@reset

👍

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.

@zzak
Ruby Programming Language member

Closing this as there is already an open ticket on redmine

@zzak zzak closed this Nov 18, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment