Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
Net::FTP list empty
Greg Willits
5/14/2009 12:09:00 AM
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
--
Posted via
http://www.ruby-...
.
1 Answer
Greg Willits
5/14/2009 12:15:00 AM
0
Greg Willits wrote:
> Ruby 1.8.6. Having trouble getting a file list from an FTP server.
Ugh. Nevermind. Had one more thought after I whacked send, and that was
it.
-- gw
--
Posted via
http://www.ruby-...
.
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Net::FTP list empty
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password