Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: ftplib question - ftp.dir() returns something and ftp.nlst()does not

Thread Tools

Re: ftplib question - ftp.dir() returns something and ftp.nlst()does not

Nico Grubert
Posts: n/a
> it's not obvious how Python could translate '' to anything other
> than an empty list, so it sure looks like a server issue.

> (or is a problem with running in passive mode? can you test with-
> out using passive mode on the same server?)

I thought using "ftp.set_pasv(0)" sets active mode so I can use
ftp.anyMethod() wihtout using passive mode?

I tried:

>>> ftp.set_pasv(0)
>>> ftp.nlst()

*cmd* 'TYPE A'
*put* 'TYPE A\r\n'
*get* '200 Type set to I.\r\n'
*resp* '200 Type set to I.'
*cmd* 'PORT 10,30,1,31,128,19'
*put* 'PORT 10,30,1,31,128,19\r\n'
*get* '200 PORT command Ok.\r\n'
*resp* '200 PORT command Ok.'
*cmd* 'NLST'
*put* 'NLST\r\n'
*get* '150 About to open data connection.\r\n'
*resp* '150 About to open data connection.'
*retr* ''
*get* '226 Transfer complete.\r\n'
*resp* '226 Transfer complete.'
>>> ftp.dir()

-r--r--r-- 1 owner group 121984 Nov 24 12:13 member.dat
-r--r--r-- 1 owner group 115 Nov 24 15:53 status.dat
-r--r--r-- 1 owner group 339 Nov 24 15:53 debug.txt

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sorted Returns List and Reversed Returns Iterator ++imanshu Python 7 08-23-2008 04:25 AM
ftplib returns EOFError Jon Bowlas Python 0 05-19-2008 11:27 AM
createImage sometime returns null and sometime returns non-null. vizlab Java 3 10-17-2007 11:21 AM
ftplib question - ftp.dir() returns something and ftp.nlst() does not Nico Grubert Python 0 11-24-2005 02:00 PM
block returns and hash element returns Trans Ruby 2 11-06-2005 12:15 PM