Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Why copy the contents of one file to another? Why not use either the OS to copy the file, or use Ruby's built-in <a href="http://ruby-doc.org/stdlib-2.1.1/libdoc/fileutils/rdoc/FileUtils.html#method-c-copy_file" rel="nofollow"><code>FileUtils.copy_file</code></a>?</p> <pre><code>ri FileUtils.copy_file FileUtils.copy_file (from ruby core) ------------------------------------------------------------------------------ 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. </code></pre> <p>A more flexible/powerful alternate is to use Ruby's built-in <a href="http://ruby-doc.org/stdlib-2.1.1/libdoc/fileutils/rdoc/FileUtils.html#method-c-cp" rel="nofollow"><code>FileUtils.cp</code></a>:</p> <pre><code>ri FileUtils.cp FileUtils.cp (from ruby core) ------------------------------------------------------------------------------ cp(src, dest, options = {}) ------------------------------------------------------------------------------ Options: preserve noop verbose Copies a file content src to dest. If dest is a directory, copies src to dest/src. If src is a list of files, then dest must be a directory. FileUtils.cp 'eval.c', 'eval.c.org' FileUtils.cp %w(cgi.rb complex.rb date.rb), '/usr/lib/ruby/1.6' FileUtils.cp %w(cgi.rb complex.rb date.rb), '/usr/lib/ruby/1.6', :verbose =&gt; true FileUtils.cp 'symlink', 'dest' # copy content, "dest" is not a symlink </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload