0

I'm having trouble connecting to a hosted account via ftp and simply listing the files in a given directory.

Below is the code I have stored in a simple .rb file

require 'net/ftp'
require 'open-uri'


Net::FTP.open('#########', '########', '#######') do |ftp|
    ftp.chdir('/webroot/irst/connect')
    files = ftp.list('n*')
    puts '#{files}'
end

It seems to connect to the hosted account fine but always says it can't find directory. `getresp': 550 Can't change directory to /webroot/irst/connect: No such file or directory (Net::FTPPermError)

I do have it set up that the ftp user can only have access to this particular directory on my hosted account. Not sure if that makes a difference or not. Any help is appreciated.

RubyDude1012
  • 477
  • 1
  • 8
  • 14

0 Answers0