FileUtils doc says
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 two are obvious.
According to the comment of
copy_entry, which is called from
If +preserve+ is true, this method preserves owner, group, and modified time. Permissions are copied regardless +preserve+.
copy_metadata, which is called from
copy_entry, is calling
lstat to acquire the
mtime from copy source file, and appling it to copy destination using
def copy_metadata(path) st = lstat() if !st.symlink? File.utime st.atime, st.mtime, path end begin if st.symlink? begin File.lchown st.uid, st.gid, path rescue NotImplementedError end else File.chown st.uid, st.gid, path end rescue Errno::EPERM # clear setuid/setgid ... omitted ... end end