Package twisted :: Package protocols :: Module ftp |
[frames | no frames]

## Module twisted.protocols.ftp

    File Transfer Protocol support for Twisted Python.

    Stability: semi-stable

    Maintainer: U{Andrew Bennetts<mailto:spiv@twistedmatrix.com>}

    Future Plans: The server will be re-written.  The goal for the server is that
    it should be secure, high-performance, and overloaded with stupid features.
    The client is probably fairly final, but should share more code with the
    server, and some details could still change.

    Warning: The FTP server is probably insecure, don't use it on open networks.

    Server TODO:

     * Authorization
       User / Password is stored in a dict (factory.userdict) in plaintext
       Use cred
       Separate USER / PASS from mainloop

     * Ascii-download
       Currently binary only. Ignores TYPE

     * Missing commands
       HELP, REST, STAT, ...

     * Print out directory-specific messages
       As in READMEs etc

     * Testing
       Test at every ftp-program available and on any platform.
       Automated tests

     * Security
       PORT needs to reply correctly if it fails
       The paths are done by os.path; use the "undocumented" module posixpath

     * Etc
       Documentation, Logging, Procedural content, Localization, Telnet PI,
       stop LIST from blocking...
       Highest priority: Resources.

    DOCS:

     * Base information: RFC0959
     * Security: RFC2577

Classes
`DTP` | A Client/Server-independent implementation of the DTP-protocol.
`DTPFactory` | The DTP-Factory.
`FTP` | An FTP server.
`FTPClient` | A Twisted FTP Client
`FTPCommand` |
`FTPDataPortFactory` | Factory for data connections that use the PORT command
`FTPFactory` |
`FTPFileListProtocol` | Parser for standard FTP file listings
`ProtocolWrapper` |
`SenderProtocol` |
`SendFileTransfer` | Producer, server to client

Exceptions
`BadResponse` |
`CommandFailed` |
`ConnectionLost` |
`FTPError` |
`UnexpectedResponse` |

Function Summary
| ``decodeHostPort`(line)` Decode an FTP response specifying a host and port.
| ``parsePWDResponse`(response)` Returns the path from a response to a PWD command.

Variable Summary
`dict` | `ftp_reply` = `{'guestok': '230 Guest login ok, access rest...`

Function Details

### decodeHostPort(line) Decode an FTP response specifying a host and port. Returns: a 2-tuple of (host, port).

### parsePWDResponse(response) Returns the path from a response to a PWD command. Responses typically look like:
       257 "/home/andrew" is current directory.
For this example, I will return `'/home/andrew'`. If I can't find the path, I return `None`.

Variable Details

    ### ftp_reply Type: `dict` Value:
        {'abort': '226 Abort successful',
         'cwdok': '250 CWD command successful.',
         'epsv': '229 Entering Extended Passive Mode (|||%s|).',
         'file': '150 File status okay; about to open data connection.',
         'fileok': '226 Transfer Complete.',
         'getabort': '426 Transfer aborted.  Data connection closed.',
         'goodbye': '221 Goodbye.',
         'guest': '331 Guest login ok, type your name as password.',
        ...

Generated by Epydoc 2.0 on Sat Oct 25 00:54:54 2003 | http://epydoc.sf.net