Skip to content

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

class method

FileUtils.copy_file

copy_file(src, dest, preserve = false, dereference = true)

Copies file contents of src to dest. Both of src and dest must be a path name.

See also #copy_file .copy_entry .copy_stream .copy also in 4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.0