[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-list
Subject:    Re: List all files using FTP
From:       "Giampaolo Rodola'" <gnewsg () gmail ! com>
Date:       2008-04-30 14:20:15
Message-ID: 2762d539-c3c6-4930-8776-ae0943faec78 () 24g2000hsh ! googlegroups ! com
[Download RAW message or body]

On 6 Mar, 18:46, Anders Eriksson <andi...@gmail.com> wrote:
> Hello,
>
> I need to list all the files on myFTPaccount (multiple subdirectories). I
> don't have shell access to the account.
>
> anyone that has a program that will do this?
>
> // Anders
> --
> English is not my first, or second, language
> so anything strange, or insulting, is due to
> the translation.
> Please correct me so I may improve my English!

If you mean listing ALL files including those contained in sub
directories if the server supports globbing you can issue a "STAT *"
command and receive the list of all files on the command channel in an
"ls -lR *"-like form.
Not tested:

>>> import ftplib
>>> f = ftplib.FTP()
>>> f.connect('ftpserver.domain', 21)
>>> f.login()
>>> f.sendcmd('STAT *')
an "ls -lR *" is expected to come
--
http://mail.python.org/mailman/listinfo/python-list
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic