List all files using FTP

Discussion in 'Python' started by Anders Eriksson, Mar 6, 2008.

  1. Hello,

    I need to list all the files on my FTP account (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!
     
    Anders Eriksson, Mar 6, 2008
    #1
    1. Advertising

  2. Anders Eriksson

    jay graves Guest

    On Mar 6, 10:46 am, Anders Eriksson <> wrote:
    > I need to list all the files on my FTP account (multiple subdirectories). I
    > don't have shell access to the account.
    > anyone that has a program that will do this?


    Not offhand, but you can look at the ftpmirror.py script for
    inspiration.
    It should be in your Tools/scripts/ subdirectory of your Python
    installation.

    ....
    Jay Graves
     
    jay graves, Mar 6, 2008
    #2
    1. Advertising

  3. On Thu, Mar 6, 2008 at 6:11 PM, jay graves <> wrote:
    > On Mar 6, 10:46 am, Anders Eriksson <> wrote:
    > > I need to list all the files on my FTP account (multiple subdirectories). I
    > > don't have shell access to the account.
    > > anyone that has a program that will do this?

    >
    > Not offhand, but you can look at the ftpmirror.py script for
    > inspiration.
    > It should be in your Tools/scripts/ subdirectory of your Python
    > installation.


    This might be of use:

    <http://ftputil.sschwarzer.net/trac>

    --
    Cheers,
    Simon B.

    http://www.brunningonline.net/simon/blog/
     
    Simon Brunning, Mar 6, 2008
    #3
  4. On Thu, 6 Mar 2008 20:07:46 +0000, Simon Brunning wrote:

    > This might be of use:
    >
    > <http://ftputil.sschwarzer.net/trac>


    Nice, Just what I needed!

    Thank you!

    // 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!
     
    Anders Eriksson, Mar 7, 2008
    #4
  5. On 6 Mar, 18:46, Anders Eriksson <> 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
     
    Giampaolo Rodola', Apr 30, 2008
    #5
    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. someone

    FTP over SSL vs FTP over SSH

    someone, Apr 24, 2004, in forum: Java
    Replies:
    1
    Views:
    4,591
    iksrazal
    Apr 25, 2004
  2. Thomas W
    Replies:
    2
    Views:
    602
    Fredrik Lundh
    Mar 16, 2005
  3. Jeff Miller
    Replies:
    0
    Views:
    505
    Jeff Miller
    Mar 26, 2009
  4. D. Buck
    Replies:
    2
    Views:
    497
    D. Buck
    Jun 29, 2004
  5. Asaf Sinai
    Replies:
    1
    Views:
    256
    Chris Davies
    Jul 4, 2006
Loading...

Share This Page