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

Discussion in 'Python' started by Nico Grubert, Nov 25, 2005.

  1. Nico Grubert

    Nico Grubert Guest

    > 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
    >>>



    Nico
    Nico Grubert, Nov 25, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mikael
    Replies:
    0
    Views:
    401
    Mikael
    Jul 14, 2004
  2. Nico Grubert
    Replies:
    0
    Views:
    620
    Nico Grubert
    Nov 24, 2005
  3. loial
    Replies:
    1
    Views:
    1,760
    Giampaolo Rodola'
    Dec 7, 2007
  4. Jon Bowlas

    ftplib returns EOFError

    Jon Bowlas, May 19, 2008, in forum: Python
    Replies:
    0
    Views:
    288
    Jon Bowlas
    May 19, 2008
  5. Ari Brown

    Net::FTP and ftp.dir()

    Ari Brown, Jul 16, 2007, in forum: Ruby
    Replies:
    0
    Views:
    78
    Ari Brown
    Jul 16, 2007
Loading...

Share This Page