File.copy for 1.9

I am a little lost as to where to find File.copy for 1.9

This worked in 1.8.6
require 'ftools'
File.copy('filename', 'dest_dir')

and in 1.9 is it this?

require 'fileutils'
File.copy_stream('filename', 'dest_name')

Did File.copy('name', 'dest_dir') disappear?
Thanks!
-=r

···

--
Posted via http://www.ruby-forum.com/.

ftools has been deprecated in 1.9

Use FileUtils.cp instead.

···

On May 9, 5:00 pm, Roger Pack <rogerpack2...@gmail.com> wrote:

I am a little lost as to where to find File.copy for 1.9

This worked in 1.8.6
require 'ftools'
File.copy('filename', 'dest_dir')

and in 1.9 is it this?

require 'fileutils'
File.copy_stream('filename', 'dest_name')

Did File.copy('name', 'dest_dir') disappear?

--
Luis Lavena

Roger Pack wrote:

I am a little lost as to where to find File.copy for 1.9

This worked in 1.8.6
require 'ftools'
File.copy('filename', 'dest_dir')

and in 1.9 is it this?

require 'fileutils'
File.copy_stream('filename', 'dest_name')

Did File.copy('name', 'dest_dir') disappear?
Thanks!
-=r

require 'fileutils'
Fileutils.cp source, dest

Should be:
require 'fileutils'
FileUtils.cp source, dest #note camel case for FileUtils

Sam wrote in post #814551:

···

Roger Pack wrote:

Did File.copy('name', 'dest_dir') disappear?
Thanks!
-=r

require 'fileutils'
Fileutils.cp source, dest

--
Posted via http://www.ruby-forum.com/\.