ftp mget

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • allanc

    ftp mget

    Anybody know if there's an ftp client in python that can do an mget?

    My current implementation of an mget uses ftpconnection.n lst() to retrieve
    the list of filenames. Then iterates through this list with
    retrlines('RETR ' + fname,callback) .

    I'd like to eliminate a LIST command on the ftp server altogether.

    Thanks to all.

    Allan
  • Rich Krauter

    #2
    Re: ftp mget

    On Thu, 2004-03-25 at 18:54, allanc wrote:[color=blue]
    > Anybody know if there's an ftp client in python that can do an mget?
    >
    > My current implementation of an mget uses ftpconnection.n lst() to retrieve
    > the list of filenames. Then iterates through this list with
    > retrlines('RETR ' + fname,callback) .
    >
    > I'd like to eliminate a LIST command on the ftp server altogether.
    >
    > Thanks to all.[/color]


    You may want to look in the python distribution at the script
    Tools/scripts/ftpmirror.py. It's referenced on the module documentation
    page for ftplib.
    It basically does what you're doing - parsing text returned by the LIST
    command. It will probably give you some ideas, or let you know whether
    you're barking up the wrong tree.

    Rich

    Comment

    • Eddie Corns

      #3
      Re: ftp mget

      allanc <allan_NOSPAMcu enca@nospamyaho o.com> writes:
      [color=blue]
      >Anybody know if there's an ftp client in python that can do an mget?[/color]
      [color=blue]
      >My current implementation of an mget uses ftpconnection.n lst() to retrieve
      >the list of filenames. Then iterates through this list with
      >retrlines('RET R ' + fname,callback) .[/color]
      [color=blue]
      >I'd like to eliminate a LIST command on the ftp server altogether.[/color]

      A quick scan of the FTP RFC at:



      (specifically "file transfer functions") suggests that there is no command to
      get multiple files by globbing and that you have to do it this way.

      Eddie

      Comment

      Working...