File.copy for 1.9


#1

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


#2

On May 9, 5:00 pm, Roger P. removed_email_address@domain.invalid wrote:

Did File.copy(‘name’, ‘dest_dir’) disappear?

ftools has been deprecated in 1.9

Use FileUtils.cp instead.


#3

Roger P. wrote:

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

require ‘fileutils’
Fileutils.cp source, dest


#4

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

Sam wrote in post #814551:

Roger P. wrote:

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

require ‘fileutils’
Fileutils.cp source, dest