twisted.protocols.ftp.IFTPShell

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

## Class IFTPShell

    Interface --+
                |
               IFTPShell

An abstraction of the shell commands used by the FTP protocol for a given user account

Method Summary
| ``cdup`(self)` changes to the parent of the current working directory
| ``cwd`(self, path)` Change working directory from the rfc: This command allows the user to work with a different directory or dataset for file storage or retrieval without altering his login or accounting information.
| ``dele`(self, path)` This command causes the file specified in the pathname to be deleted at the server site.
| ``list`(self, path)` @return: a tuple of (StringIO_object, size) containing the directory listing to be sent to the client via the DTP from the rfc: This command causes a list to be sent from the server to the passive DTP.
| ``mapCPathToSPath`(self, path)` converts a specified path relative to the user's top level directory into a path in the filesystem representation
string | ``mdtm`(self, path)` get the date and time for path
| ``mkd`(self, path)` This command causes the directory specified in the pathname to be created as a directory (if the pathname is absolute) or as a subdirectory of the current working directory (if the pathname is relative).
| ``nlst`(self, path)` This command causes a directory listing to be sent from server to user site.
| ``pwd`(self)` Print working directory command
| ``retr`(self, path)` This command causes the server-DTP to transfer a copy of the file, specified in the pathname, to the server- or user-DTP at the other end of the data connection.
| ``rmd`(self, path)` This command causes the directory specified in the pathname to be removed as a directory (if the pathname is absolute) or as a subdirectory of the current working directory (if the pathname is relative).
| ``size`(self, path)` returns the size of the file specified by path in bytes
| ``stor`(self, params)` This command causes the server-DTP to accept the data transferred via the data connection and to store the data as a file at the server site.

Method Details

### cdup(self) changes to the parent of the current working directory

### cwd(self, path)
    Change working directory

    from the rfc:
        This command allows the user to work with a different
        directory or dataset for file storage or retrieval without
        altering his login or accounting information.  Transfer
        parameters are similarly unchanged.  The argument is a
        pathname specifying a directory or other system dependent
        file group designator.

    @param path: the path you're interested in
    @type path: string

### dele(self, path) This command causes the file specified in the pathname to be deleted at the server site. Parameters: `path` - the path you're interested in (type=string)

### list(self, path)
    @return: a tuple of (StringIO_object, size) containing the directory
    listing to be sent to the client via the DTP

    from the rfc:
        This command causes a list to be sent from the server to the
        passive DTP.  If the pathname specifies a directory or other
        group of files, the server should transfer a list of files
        in the specified directory.  If the pathname specifies a
        file then the server should send current information on the
        file.  A null argument implies the user's current working or
        default directory.

### mapCPathToSPath(self, path) converts a specified path relative to the user's top level directory into a path in the filesystem representation example: if the user's tld is /home/foo and there's a file in the filesystem /home/foo/bar/spam.tar.gz the user would specify path /bar/spam.tar.gz in the ftp command, and this function would translate it into /home/foo/bar/spam.tar.gz @returns a tuple (cpath, spath) where cpath is the client's top level directory plus path, and spath is cpath in relation to the server's filesystem. cpath is an illusion, spath is a real file in the filesystem

### mdtm(self, path) get the date and time for path Parameters: `path` - the path you're interested in (type=string) Returns: the date of path in the form of %Y%m%d%H%M%S (type=string)

### mkd(self, path) This command causes the directory specified in the pathname to be created as a directory (if the pathname is absolute) or as a subdirectory of the current working directory (if the pathname is relative). Parameters: `path` - the path you're interested in (type=string)

### nlst(self, path) This command causes a directory listing to be sent from server to user site. The pathname should specify a directory or other system-specific file group descriptor; a null argument implies the current directory. This command is intended to return information that can be used by a program to further process the files automatically. For example, in the implementation of a "multiple get" function. Parameters: `path` - the path to generate output for (type=string)

### pwd(self) Print working directory command

### retr(self, path) This command causes the server-DTP to transfer a copy of the file, specified in the pathname, to the server- or user-DTP at the other end of the data connection. The status and contents of the file at the server site shall be unaffected. Returns: a tuple of (fp, size) where fp is an opened file-like object to the data requested and size is the size, in bytes, of fp

### rmd(self, path) This command causes the directory specified in the pathname to be removed as a directory (if the pathname is absolute) or as a subdirectory of the current working directory (if the pathname is relative). Parameters: `path` - the path you're interested in (type=string)

### size(self, path) returns the size of the file specified by path in bytes

### stor(self, params) This command causes the server-DTP to accept the data transferred via the data connection and to store the data as a file at the server site. If the file specified in the pathname exists at the server site, then its contents shall be replaced by the data being transferred. A new file is created at the server site if the file specified in the pathname does not already exist.

Generated by Epydoc 2.0 on Sat May 15 20:08:39 2004 | http://epydoc.sf.net