Skip to content

End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

instance method

FileUtils#copy_entry

copy_entry(src, dest, preserve = false, dereference_root = false, remove_destination = false)

Copies a file system entry src to dest. If src is a directory, this method copies its contents recursively. This method preserves file types, c.f. symlink, directory… (FIFO, device files and etc. are not supported yet)

Both of src and dest must be a path name. src must exist, dest must not exist.

If preserve is true, this method preserves owner, group, and modified time. Permissions are copied regardless preserve.

If dereference_root is true, this method dereference tree root.

If remove_destination is true, this method removes each destination file before copy.

See also .copy_entry #copy #copy_file #compare_stream also in 4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.1