Ruby - FileUtils - dereference_root option
Asked Answered
H

1

7

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.

Howland answered 3/8, 2013 at 21:20 Comment(0)
T
5

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'.

Terricolous answered 3/8, 2013 at 23:10 Comment(1)
So how do you get it recursively?Jehu

© 2022 - 2024 — McMap. All rights reserved.