I have more information ....
Just create an array and add elements with the folders names you want to
create.
ftp_folder_create.each{ |folder|
print "\n Creating folder ",folder
ftp.mkdir(folder)
end
}
All works great, if they folders doesn't exist and you can create them.
Add error control and check before creating the folder, if it really
exists, and you'll get the error after creating 50 folders.
ftp_folder_create.each{ |folder|
print "\n Creating folder ",folder
begin
ftp.chdir(folder)
rescue Net::FTPPermError, NameError => boom # it doesn't exist => create
it
ftp.mkdir(folder)
end
}
Anyone can confirm this ?
thanks,
r.
--
Posted via http://www.ruby-forum.com/.