Ruby 1.8.6. Having trouble getting a file list from an FTP server.
AFAICT the connection itself is valid (connections via GUI apps all work
just fine). Yet every attempt to get a file listing comes up empty or
nil.
#<Net::FTP:0x5ae678 @passive=true,
@last_response=“250 CWD command successful.\n”,
@sock=#TCPSocket:0x5ae36c,
@mon_entering_queue=[],
@binary=true,
@mon_count=0,
@resume=false,
@mon_owner=nil,
@debug_mode=false,
@welcome=“230- {blah blah blah} \n”,
@last_response_code=“250”,
@mon_waiting_queue=[]>
I have a method like this (with a couple debug lines):
def connect(host=’’,user=’’,password=’’,origin=’’)
connection = Net::FTP.new(host)
connection.passive = true
connection.login(user, password)
connection.chdir(origin)
p connection
p connection.list # .list(’*’), .nlst, .dir() all come up empty
return connection
end
I’m not even sure how to go about debugging this to see why the file
list would be empty.
Any clues appreciated…
– gw