⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ch18_02.htm

📁 by Randal L. Schwartz and Tom Phoenix ISBN 0-596-00132-0 Third Edition, published July 2001. (See
💻 HTM
📖 第 1 页 / 共 3 页
字号:
</pre><p><a name="INDEX-2309" />Transfers a file between two remoteservers. Arguments are:</p><dl><dt><i><em class="replaceable"><tt>file1</tt></em></i></dt><dd>The file to transfer from the server represented by the Net::FTPobject.</p></dd><dt><i><em class="replaceable"><tt>server</tt></em></i></dt><dd>Destination server.</p></dd><dt><i><em class="replaceable"><tt>file2</tt></em></i></dt><dd>New name of the file on the destination server. If omitted, theoriginal name is used.</p></dd></dl></div><a name="INDEX-2310" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>pasv_xfer_unique</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>$<em class="replaceable">ftp</em>-&gt;pasv_xfer_unique(<em class="replaceable">file1</em>, <em class="replaceable">server</em>[, <em class="replaceable">file2</em>])</pre><p><a name="INDEX-2310" />Like <tt class="literal">pasv_xfer</tt>,but stores the file on the remote server with a new (unique) name.</p></div><a name="INDEX-2311" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>port</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>$<em class="replaceable">ftp</em>-&gt;port([<em class="replaceable">port</em>])</pre><p><a name="INDEX-2311" />Sends a PORT command telling the serverto use port <em class="replaceable"><tt>port</tt></em>. With no argument, asocket is created, and its information is sent.</p></div><a name="INDEX-2312" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>put</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>$<em class="replaceable">ftp</em>-&gt;put(<em class="replaceable">local</em>[, <em class="replaceable">remote</em>])</pre><p><a name="INDEX-2312" />Puts a file ontothe server. Arguments are:</p><dl><dt><i><em class="replaceable"><tt>local</tt></em></i></dt><dd>The name of the file to transfer from the local system, or afilehandle.</p></dd><dt><i><em class="replaceable"><tt>remote</tt></em></i></dt><dd>The new filename on the remote system. If omitted, the same filenameis used. If <em class="replaceable"><tt>local</tt></em> is a filehandle, theremote filename must be specified.</p></dd></dl></div><a name="INDEX-2313" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>put_unique</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>$<em class="replaceable">ftp</em>-&gt;put_unique(<em class="replaceable">local</em>[, <em class="replaceable">remote</em>])</pre><p><a name="INDEX-2313" />Puts a file with a unique name ontothe server. Arguments are:</p><dl><dt><i><em class="replaceable"><tt>local</tt></em></i></dt><dd>The name of the file to transfer from the local system, or afilehandle.</p></dd><dt><i><em class="replaceable"><tt>remote</tt></em></i></dt><dd>The new filename on the remote system. If a file exists by that name,a new unique filename is created.</p></dd></dl></div><a name="INDEX-2314" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>pwd</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>$<em class="replaceable">ftp</em>-&gt;pwd(  )</pre><p><a name="INDEX-2314" />Returns the current directory path.</p></div><a name="INDEX-2315" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>quit</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>$<em class="replaceable">ftp</em>-&gt;quit(  )</pre><p><a name="INDEX-2315" />Closes the connection.</p></div><a name="INDEX-2316" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>quot</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>$<em class="replaceable">ftp</em>-&gt;quot(<em class="replaceable">cmd</em>[, <em class="replaceable">args</em>])</pre><p><a name="INDEX-2316" />Sends a literal FTP protocolcommand to the server and waits for a response. Returns the mostsignificant digit of the response code.</p></div><a name="INDEX-2317" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>rename</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>$<em class="replaceable">ftp</em>-&gt;rename(<em class="replaceable">file1</em>, <em class="replaceable">file2</em>)</pre><p><a name="INDEX-2317" />Renames a file on the server. Argumentsare:</p><dl><dt><i><em class="replaceable"><tt>file1</tt></em></i></dt><dd>The old name of the file</p></dd><dt><i><em class="replaceable"><tt>file2</tt></em></i></dt><dd>The new name of the file</p></dd></dl></div><a name="INDEX-2318" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>retr</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>$<em class="replaceable">ftp</em>-&gt;retr(<em class="replaceable">file</em>)</pre><p><a name="INDEX-2318" />Retrieves file<em class="replaceable"><tt>file</tt></em> from the remote server. If the usercalls either <tt class="literal">pasv</tt> or <tt class="literal">port</tt>,returns true or false. Otherwise, returns a reference to aNet::FTP::dataconn object.</p></div><a name="INDEX-2319" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>rmdir</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>$<em class="replaceable">ftp</em>-&gt;rmdir(<em class="replaceable">dir</em>)</pre><p><a name="INDEX-2319" />Removes directory<em class="replaceable"><tt>dir</tt></em>.</p></div><a name="INDEX-2320" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>size</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>$<em class="replaceable">ftp</em>-&gt;size(<em class="replaceable">file</em>)</pre><p><a name="INDEX-2320" />Returns the size of file<em class="replaceable"><tt>file</tt></em> in bytes.</p></div><a name="INDEX-2321" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>stor</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>$<em class="replaceable">ftp</em>-&gt;stor(<em class="replaceable">file</em>)</pre><p><a name="INDEX-2321" />Tells the server to store a newfile under the name <em class="replaceable"><tt>file</tt></em>. If the usercalls either <tt class="literal">pasv</tt> or <tt class="literal">port</tt>,returns true or false. Otherwise, returns a reference to aNet::FTP::dataconn object.</p></div><a name="INDEX-2322" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>stou</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>$<em class="replaceable">ftp</em>-&gt;stou(<em class="replaceable">file</em>)</pre><p><a name="INDEX-2322" />Like <tt class="literal">stor</tt>, butstores file on the remote server with a unique name,<em class="replaceable"><tt>file</tt></em>. If the user calls either<tt class="literal">pasv</tt> or <tt class="literal">port</tt>, returns true orfalse. Otherwise, returns a reference to a Net::FTP::dataconn object.</p></div><a name="INDEX-2323" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>supported</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>$<em class="replaceable">ftp</em>-&gt;supported(<em class="replaceable">cmd</em>)</pre><p><a name="INDEX-2323" />Returns true if the server supportsthe command <em class="replaceable"><tt>cmd</tt></em>.</p></div><a name="INDEX-2324" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>type</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>$<em class="replaceable">ftp</em>-&gt;type(<em class="replaceable">type</em>[, <em class="replaceable">args</em>])</pre><p><a name="INDEX-2324" />Changes the type of data transfer.Possible types are <tt class="literal">ascii</tt>,<tt class="literal">ebcdic</tt>, <tt class="literal">byte</tt>, and<tt class="literal">binary</tt>. The value of<em class="replaceable"><tt>args</tt></em> depends on the type.</p></div><a name="INDEX-2325" /><a name="INDEX-2326" /><a name="INDEX-2327" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>unique_name</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>$<em class="replaceable">ftp</em>-&gt;unique_name(  )</pre><p><a name="INDEX-2325" />Returns the name of the last filestored with a unique name.<a name="INDEX-2326" /><a name="INDEX-2327" /> </p></div><hr width="684" align="left" /><div class="navbar"><table width="684" border="0"><tr><td align="left" valign="top" width="228"><a href="ch18_01.htm"><img src="../gifs/txtpreva.gif" alt="Previous" border="0" /></a></td><td align="center" valign="top" width="228"><a href="index.htm"><img src="../gifs/txthome.gif" alt="Home" border="0" /></a></td><td align="right" valign="top" width="228"><a href="ch18_03.htm"><img src="../gifs/txtnexta.gif" alt="Next" border="0" /></a></td></tr><tr><td align="left" valign="top" width="228">18. FTP</td><td align="center" valign="top" width="228"><a href="index/index.htm"><img src="../gifs/index.gif" alt="Book Index" border="0" /></a></td><td align="right" valign="top" width="228">18.3. FTP Configuration with Net::Netrc</td></tr></table></div><hr width="684" align="left" /><img src="../gifs/navbar.gif" usemap="#library-map" border="0" alt="Library Navigation Links" /><p><p><font size="-1"><a href="copyrght.htm">Copyright &copy; 2002</a> O'Reilly &amp; Associates. All rights reserved.</font></p><map name="library-map"><area shape="rect" coords="1,0,85,94" href="../index.htm"><area shape="rect" coords="86,1,178,103" href="../lwp/index.htm"><area shape="rect" coords="180,0,265,103" href="../lperl/index.htm"><area shape="rect" coords="267,0,353,105" href="../perlnut/index.htm"><area shape="rect" coords="354,1,446,115" href="../prog/index.htm"><area shape="rect" coords="448,0,526,132" href="../tk/index.htm"><area shape="rect" coords="528,1,615,119" href="../cookbook/index.htm"><area shape="rect" coords="617,0,690,135" href="../pxml/index.htm"></map></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -