Coping all files in a folder

N

nicknewton

require 'ftools'

source="c:\\axis\\FTP storage"
dest="c:\\axis\\images"
For some reason this code will not work, I am not sure why. It will
get into the loop with the copy state meant and then error.

dir.each do|file|
copy= true
puts "#{file}"

stop=gets

if file=="."
copy=false
end

if file==".."
copy=false
end

if copy==true
puts "I'm in"
File.copy( "#{file}", "#{dest}")
end

Any advice on what I am doing wrong would be great, I am pretty new to
Ruby and programming in general.

Thanks
Nick

end
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top