Can someone explain me exactly (better if with examples) the meaning of the dereference_root option in FileUtils.cp_r and in other class method of the same class?
Thank you in advance.
# Installing Ruby library "mylib" under the site_ruby FileUtils. rm_r site_ruby + '/mylib', :force FileUtils. cp_r 'lib/', site_ruby + '/mylib' # Examples of copying several files to target directory.
This program is free software. You can distribute/modify this program under the same terms of ruby. Namespace for several file utility methods for copying, moving, removing, etc. The options parameter is a hash of options, taken from the list :force, :noop, :preserve, and :verbose. :noop means that no changes are made. The other three are obvious.
This program is free software. You can distribute/modify this program under the same terms of ruby. Namespace for several file utility methods for copying, moving, removing, etc. require 'fileutils' FileUtils.cd (dir, options) FileUtils.cd (dir, options) {|dir| ....
It applies only if your source file/directory is symbolic link. If it is and you specify this option, then FileUtils.cp_r
will follow this link and copy the original files otherwise you will get just a copy of the symlink.
But this doesn't apply recursively. So if you will have other symlinks inside your source folder they will be just copied as is, without 'dereferencing'.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With