twisted.protocols.ftp.IFTPShell.html [plain text]
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>twisted.protocols.ftp.IFTPShell</title>
<link rel="stylesheet" href="epydoc.css" type="text/css"></link>
</head>
<body bgcolor="white" text="black" link="blue" vlink="#204080"
alink="#204080">
<!-- =========== START OF NAVBAR =========== -->
<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">
<tr valign="center">
<th class="navbar"> <a class="navbar" href="twisted.html">Home</a> </th>
<th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>
<th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>
<th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>
<th class="navbar" align="right" width="100%">
<table border="0" cellpadding="0" cellspacing="0">
<tr><th class="navbar" align="center">
<p class="nomargin">
<a class="navbar" target="_top" href="http://twistedmatrix.com/">Twisted 1.3.0rc1</a>
</p></th></tr></table>
</th>
</tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
<tr valign="top">
<td width="100%">
<font size="-1"><b class="breadcrumbs">
<a href="twisted.html">Package twisted</a> ::
<a href="twisted.protocols.html">Package protocols</a> ::
<a href="twisted.protocols.ftp.html">Module ftp</a> ::
Class IFTPShell
</b></font></br>
</td>
<td><table cellpadding="0" cellspacing="0">
<tr><td align="right"><font size="-2">[<a href="frames.html"target="_top">frames</a> | <a href="twisted.protocols.ftp.IFTPShell.html" target="_top">no frames</a>]</font></td></tr>
</table></td>
</tr></table>
<!-- =========== START OF CLASS DESCRIPTION =========== -->
<h2 class="class">Class IFTPShell</h2>
<pre class="base-tree">
<a href="twisted.python.components.Interface.html"><code>Interface</code></a> --+
|
<b>IFTPShell</b>
</pre><br />
<hr/>
An abstraction of the shell commands used by the FTP protocol for a
given user account
<hr/>
<!-- =========== START OF METHOD SUMMARY =========== -->
<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="summary">
<th colspan="2">Method Summary</th></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
<td><code><span class="summary-sig"><a href="twisted.protocols.ftp.IFTPShell.html#cdup" class="summary-sig-name"><code>cdup</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
<br />
changes to the parent of the current working directory</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
<td><code><span class="summary-sig"><a href="twisted.protocols.ftp.IFTPShell.html#cwd" class="summary-sig-name"><code>cwd</code></a>(<span class=summary-sig-arg>self</span>,
<span class=summary-sig-arg>path</span>)</span></code>
<br />
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.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
<td><code><span class="summary-sig"><a href="twisted.protocols.ftp.IFTPShell.html#dele" class="summary-sig-name"><code>dele</code></a>(<span class=summary-sig-arg>self</span>,
<span class=summary-sig-arg>path</span>)</span></code>
<br />
This command causes the file specified in the pathname to be deleted
at the server site.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
<td><code><span class="summary-sig"><a href="twisted.protocols.ftp.IFTPShell.html#list" class="summary-sig-name"><code>list</code></a>(<span class=summary-sig-arg>self</span>,
<span class=summary-sig-arg>path</span>)</span></code>
<br />
@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.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
<td><code><span class="summary-sig"><a href="twisted.protocols.ftp.IFTPShell.html#mapCPathToSPath" class="summary-sig-name"><code>mapCPathToSPath</code></a>(<span class=summary-sig-arg>self</span>,
<span class=summary-sig-arg>path</span>)</span></code>
<br />
converts a specified path relative to the user's top level directory
into a path in the filesystem representation</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1"> string
</font></td>
<td><code><span class="summary-sig"><a href="twisted.protocols.ftp.IFTPShell.html#mdtm" class="summary-sig-name"><code>mdtm</code></a>(<span class=summary-sig-arg>self</span>,
<span class=summary-sig-arg>path</span>)</span></code>
<br />
get the date and time for path</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
<td><code><span class="summary-sig"><a href="twisted.protocols.ftp.IFTPShell.html#mkd" class="summary-sig-name"><code>mkd</code></a>(<span class=summary-sig-arg>self</span>,
<span class=summary-sig-arg>path</span>)</span></code>
<br />
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).</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
<td><code><span class="summary-sig"><a href="twisted.protocols.ftp.IFTPShell.html#nlst" class="summary-sig-name"><code>nlst</code></a>(<span class=summary-sig-arg>self</span>,
<span class=summary-sig-arg>path</span>)</span></code>
<br />
This command causes a directory listing to be sent from server to user
site.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
<td><code><span class="summary-sig"><a href="twisted.protocols.ftp.IFTPShell.html#pwd" class="summary-sig-name"><code>pwd</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
<br />
Print working directory command</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
<td><code><span class="summary-sig"><a href="twisted.protocols.ftp.IFTPShell.html#retr" class="summary-sig-name"><code>retr</code></a>(<span class=summary-sig-arg>self</span>,
<span class=summary-sig-arg>path</span>)</span></code>
<br />
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.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
<td><code><span class="summary-sig"><a href="twisted.protocols.ftp.IFTPShell.html#rmd" class="summary-sig-name"><code>rmd</code></a>(<span class=summary-sig-arg>self</span>,
<span class=summary-sig-arg>path</span>)</span></code>
<br />
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).</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
<td><code><span class="summary-sig"><a href="twisted.protocols.ftp.IFTPShell.html#size" class="summary-sig-name"><code>size</code></a>(<span class=summary-sig-arg>self</span>,
<span class=summary-sig-arg>path</span>)</span></code>
<br />
returns the size of the file specified by path in bytes</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
<td><code><span class="summary-sig"><a href="twisted.protocols.ftp.IFTPShell.html#stor" class="summary-sig-name"><code>stor</code></a>(<span class=summary-sig-arg>self</span>,
<span class=summary-sig-arg>params</span>)</span></code>
<br />
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.</td></tr>
</table><br />
<!-- =========== START OF METHOD DETAILS =========== -->
<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="details">
<th colspan="2">Method Details</th></tr>
</table>
<a name="cdup"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
<h3><span class="sig"><span class="sig-name">cdup</span>(<span class=sig-arg>self</span>)</span>
</h3>
changes to the parent of the current working directory
<dl><dt></dt><dd>
</dd></dl>
</td></tr></table>
<a name="cwd"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
<h3><span class="sig"><span class="sig-name">cwd</span>(<span class=sig-arg>self</span>,
<span class=sig-arg>path</span>)</span>
</h3>
<pre class="literalblock">
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
</pre>
<dl><dt></dt><dd>
</dd></dl>
</td></tr></table>
<a name="dele"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
<h3><span class="sig"><span class="sig-name">dele</span>(<span class=sig-arg>self</span>,
<span class=sig-arg>path</span>)</span>
</h3>
This command causes the file specified in the pathname to be deleted
at the server site.
<dl><dt></dt><dd>
<dl><dt><b>Parameters:</b></dt>
<dd><code><b>path</b></code> -
the path you're interested in
<br /><i>
(type=string)</i>
</dd>
</dl>
</dd></dl>
</td></tr></table>
<a name="list"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
<h3><span class="sig"><span class="sig-name">list</span>(<span class=sig-arg>self</span>,
<span class=sig-arg>path</span>)</span>
</h3>
<pre class="literalblock">
@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.
</pre>
<dl><dt></dt><dd>
</dd></dl>
</td></tr></table>
<a name="mapCPathToSPath"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
<h3><span class="sig"><span class="sig-name">mapCPathToSPath</span>(<span class=sig-arg>self</span>,
<span class=sig-arg>path</span>)</span>
</h3>
<p>converts a specified path relative to the user's top level directory
into a path in the filesystem representation</p>
<p>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</p>
<p>@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.</p>
cpath is an illusion, spath is a real file in the filesystem
<dl><dt></dt><dd>
</dd></dl>
</td></tr></table>
<a name="mdtm"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
<h3><span class="sig"><span class="sig-name">mdtm</span>(<span class=sig-arg>self</span>,
<span class=sig-arg>path</span>)</span>
</h3>
get the date and time for path
<dl><dt></dt><dd>
<dl><dt><b>Parameters:</b></dt>
<dd><code><b>path</b></code> -
the path you're interested in
<br /><i>
(type=string)</i>
</dd>
</dl>
<dl><dt><b>Returns:</b></dt>
<dd>
the date of path in the form of %Y%m%d%H%M%S
<br /><i>
(type=string)</i>
</dd>
</dl>
</dd></dl>
</td></tr></table>
<a name="mkd"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
<h3><span class="sig"><span class="sig-name">mkd</span>(<span class=sig-arg>self</span>,
<span class=sig-arg>path</span>)</span>
</h3>
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).
<dl><dt></dt><dd>
<dl><dt><b>Parameters:</b></dt>
<dd><code><b>path</b></code> -
the path you're interested in
<br /><i>
(type=string)</i>
</dd>
</dl>
</dd></dl>
</td></tr></table>
<a name="nlst"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
<h3><span class="sig"><span class="sig-name">nlst</span>(<span class=sig-arg>self</span>,
<span class=sig-arg>path</span>)</span>
</h3>
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.
<dl><dt></dt><dd>
<dl><dt><b>Parameters:</b></dt>
<dd><code><b>path</b></code> -
the path to generate output for
<br /><i>
(type=string)</i>
</dd>
</dl>
</dd></dl>
</td></tr></table>
<a name="pwd"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
<h3><span class="sig"><span class="sig-name">pwd</span>(<span class=sig-arg>self</span>)</span>
</h3>
Print working directory command
<dl><dt></dt><dd>
</dd></dl>
</td></tr></table>
<a name="retr"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
<h3><span class="sig"><span class="sig-name">retr</span>(<span class=sig-arg>self</span>,
<span class=sig-arg>path</span>)</span>
</h3>
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.
<dl><dt></dt><dd>
<dl><dt><b>Returns:</b></dt>
<dd>
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
</dd>
</dl>
</dd></dl>
</td></tr></table>
<a name="rmd"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
<h3><span class="sig"><span class="sig-name">rmd</span>(<span class=sig-arg>self</span>,
<span class=sig-arg>path</span>)</span>
</h3>
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).
<dl><dt></dt><dd>
<dl><dt><b>Parameters:</b></dt>
<dd><code><b>path</b></code> -
the path you're interested in
<br /><i>
(type=string)</i>
</dd>
</dl>
</dd></dl>
</td></tr></table>
<a name="size"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
<h3><span class="sig"><span class="sig-name">size</span>(<span class=sig-arg>self</span>,
<span class=sig-arg>path</span>)</span>
</h3>
returns the size of the file specified by path in bytes
<dl><dt></dt><dd>
</dd></dl>
</td></tr></table>
<a name="stor"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
<h3><span class="sig"><span class="sig-name">stor</span>(<span class=sig-arg>self</span>,
<span class=sig-arg>params</span>)</span>
</h3>
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.
<dl><dt></dt><dd>
</dd></dl>
</td></tr></table>
<br />
<!-- =========== START OF NAVBAR =========== -->
<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">
<tr valign="center">
<th class="navbar"> <a class="navbar" href="twisted.html">Home</a> </th>
<th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>
<th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>
<th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>
<th class="navbar" align="right" width="100%">
<table border="0" cellpadding="0" cellspacing="0">
<tr><th class="navbar" align="center">
<p class="nomargin">
<a class="navbar" target="_top" href="http://twistedmatrix.com/">Twisted 1.3.0rc1</a>
</p></th></tr></table>
</th>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left"><font size="-2">Generated by Epydoc 2.0 on Sat May 15 20:08:39 2004</font></td>
<td align="right"><a href="http://epydoc.sourceforge.net"
><font size="-2">http://epydoc.sf.net</font></a></td>
</tr>
</table>
</body>
</html>