Peter Bailey wrote:
> I keep getting errors with this simple ftp script. Real names and 
> passwords have been changed to protect the innocent. I just need to send 
> the input files to the ftp target without the extensions they have.
>
> Thanks for any help.
>
> 1  require 'net/ftp'
> 2  require 'FileUtils'
> 3  Dir.chdir("E:/workflows/graphics/out/ps2k/100dpi")
> 4  ArborTextfiles = Dir.glob("*.100")
> 5  ArborTextfiles.each do |file100|
> 6    #file100.to_s
> 7	ftp = Net::FTP.open('quack.bna.com') do |ftp|
> 8	ftp.login('xxxxx','xxxxx')
> 9	ftp.chdir('/xxx/graphics/tiff_100_dpi')
> 10	ftp.putbinaryfile(file100.sub(".100",""))
>   
I think this should read:

ftp.putbinaryfile(file100, file100.sub(".100",""))

You could also do this:

ftp.putbinaryfile(file100, File.basename(file100, ".*"))

Jamey



Confidentiality Notice: This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and/or privileged information. If you are not the intended recipient(s), you are hereby notified that any dissemination, unauthorized review, use, disclosure or distribution of this email and any materials contained in any attachments is prohibited. If you receive this message in error, or are not the intended recipient(s), please immediately notify the sender by email and destroy all copies of the original message, including attachments.