Python FTP-Class w/ Resuming-Capabilities -- General Questions 
Author Message
 Python FTP-Class w/ Resuming-Capabilities -- General Questions

Hi List,

My name is Julian and I have only coded a few snippets
and small applications in python so far (about 1 year
experience).

Now I want to write an ftp-indexer (indexing files of
special interest) and a server-side-download tool (later
probably multi-threaded -> but that shall be a future
headache ;-)).

I have made myself familiar with the ftplib - but it
doesn' t seem to support resuming. (Is that right?).
Therefore I am trying to implement a small class myself
using the socket-lib.

I have the following questions:

  -> Is there already a neat tool for indexing / server-side
     download supporting resuming / multiple threads?

  -> How is the resuming implemented (didn't find the appropriate
     RFC).

  -> Is there some sample-code except for ftplib that I should have
     a look at (even other scripting-languages) / could use?

  -> Would it be easy to extend the ftplib with resuming-capabilities?

Any other thoughts and suggestions are welcome as well...

Thanks in advance,

Juilan Schaefer-Jasinski

______________________________________________________________

Frankfurt, Germany                      - Student of CS



Wed, 12 Nov 2003 19:31:30 GMT  
 Python FTP-Class w/ Resuming-Capabilities -- General Questions

Quote:
> Hi List,

> My name is Julian and I have only coded a few snippets
> and small applications in python so far (about 1 year
> experience).

> Now I want to write an ftp-indexer (indexing files of
> special interest) and a server-side-download tool (later
> probably multi-threaded -> but that shall be a future
> headache ;-)).

There will be a lot of useful code samples in the ftpmirror program *which
IIRC lives in the Tools directory of your Python distribution).

Quote:
> I have made myself familiar with the ftplib - but it
> doesn' t seem to support resuming. (Is that right?).

No. It's up to the server. When you read the documentation carefully it
points out an optional argument "rest" to the retrbinary() and transfercmd()
methods. If the server supports it ... well, the documentation says it as
well as anything (this is from section 11.5.1 of the 2.0 Library docs):

"""
If optional rest is given, a "REST" command is sent to the server, passing
rest as an argument. rest is usually a byte offset into the requested file,
telling the server to restart sending the file's bytes at the requested
offset, skipping over the initial bytes. Note however that RFC 959 requires
only that rest be a string containing characters in the printable range from
ASCII code 33 to ASCII code 126. The transfercmd() method, therefore,
converts rest to a string, but no check is performed on the string's
contents. If the server does not recognize the "REST" command, an
error_reply exception will be raised. If this happens, simply call
transfercmd() without a rest argument.
"""

Quote:
> Therefore I am trying to implement a small class myself
> using the socket-lib.

> I have the following questions:

>   -> Is there already a neat tool for indexing / server-side
>      download supporting resuming / multiple threads?

Dunno
>   -> How is the resuming implemented (didn't find the appropriate
>      RFC).

Look up the REST command in the FTP RFC, (linked from the ftplib docs).

Quote:
>   -> Is there some sample-code except for ftplib that I should have
>      a look at (even other scripting-languages) / could use?

ftpmirror as mentioned. And look for ftpStream in http://www.holdenweb.com/.

Quote:
>   -> Would it be easy to extend the ftplib with resuming-capabilities?

> Any other thoughts and suggestions are welcome as well...

Hope this helps.

regards
 Steve



Wed, 12 Nov 2003 23:37:44 GMT  
 Python FTP-Class w/ Resuming-Capabilities -- General Questions
Thanks for your help. Looks like it turned out to be a lot easyier
than I thought...

I managed to retrieve a resumed file.
Still have to think about how to put more parts of a file
together... but this should be a matter of trying.

Thanks again...



Fri, 14 Nov 2003 20:40:32 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. General Question: Source missing for some classes !?

2. Classes, OOP, Tkinter general comments and detailed questions...

3. VisualWork 5i Ftp capability

4. Adding FTP capabilities to CW app.

5. file transfer between two ftp servers with resume option

6. general question about python integration with C

7. installing python library modules (general question)

8. C++ class library/framework for Prolog-like capabilities

9. looking for class browser w/search capabilities

10. Python with the VBA recording capabilities

11. Resuming a file download with python

12. Editors with Python or Active Scripting capability?

 

 
Powered by phpBB® Forum Software