📄 ch18_02.htm
字号:
The name of the file on the remote system. If<em class="replaceable"><tt>local</tt></em> is a filehandle,<em class="replaceable"><tt>remote</tt></em> must be specified.</p></dd></dl></div><a name="INDEX-2291" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>ascii</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>->ascii([<em class="replaceable">args</em>])</pre><p><a name="INDEX-2291" />Changes the type of data transfer to<tt class="literal">ascii</tt>. Like <tt class="literal">type</tt>, without theneed to specify the first argument.</p></div><a name="INDEX-2292" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>authorize</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>->authorize([<em class="replaceable">auth</em>[, <em class="replaceable">resp</em>]])</pre><p><a name="INDEX-2292" />Authorizes the user to send dataoutside the firewall, for use with FTP proxies. If authorization<em class="replaceable"><tt>auth</tt></em> and response<em class="replaceable"><tt>resp</tt></em> are not specified,<tt class="literal">authorize</tt> uses Net::Netrc to do a lookup.</p><p>Called with no arguments by <tt class="literal">login</tt> if theconnection is through a firewall.</p></div><a name="INDEX-2293" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>binary</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>->binary([<em class="replaceable">args</em>])</pre><p><a name="INDEX-2293" />Changes the type of data transferto <tt class="literal">binary</tt>. Like <tt class="literal">type</tt>, withoutthe need to specify the first argument.</p></div><a name="INDEX-2294" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>byte</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>->byte([<em class="replaceable">args</em>])</pre><p><a name="INDEX-2294" />Changes the data transfer type to<tt class="literal">byte</tt>. Not supported. If specified, defaults tobinary. Like <tt class="literal">type</tt>, without the need to specify thefirst argument.</p></div><a name="INDEX-2295" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>cdup</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>->cdup( )</pre><p><a name="INDEX-2295" />Goes up one level in the directoryhierarchy.</p></div><a name="INDEX-2296" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>cwd</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>->cwd([<em class="replaceable">dir</em>])</pre><p><a name="INDEX-2296" />Changes the working directory to<em class="replaceable"><tt>dir</tt></em>. With no argument, changes thedirectory to root.</p></div><a name="INDEX-2297" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>delete</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>->delete([<em class="replaceable">filename</em>])</pre><p><a name="INDEX-2297" />Deletes the specified file from theserver.</p></div><a name="INDEX-2298" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>dir</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>->dir([<em class="replaceable">dir</em>])</pre><p><a name="INDEX-2298" />Lists the specified serverdirectory in long format. Returns a reference to the list.<em class="replaceable"><tt>dir</tt></em> defaults to the current workingdirectory.</p></div><a name="INDEX-2299" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>ebcdic</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>->ebcdic([<em class="replaceable">args</em>])</pre><p><a name="INDEX-2299" />Changes the data transfer type to<tt class="literal">ebcdic</tt>. Not supported. If specified, defaults tobinary. Like <tt class="literal">type</tt>, without the need to specify thefirst argument.</p></div><a name="INDEX-2300" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>get</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>->get(<em class="replaceable">remote</em>[, <em class="replaceable">local</em>])</pre><p><a name="INDEX-2300" />Retrieves a file from the server. Ifspecified, <em class="replaceable"><tt>local</tt></em> is the name to give thefile on the local system; otherwise, the name stays the same.Arguments are:</p><dl><dt><i><em class="replaceable"><tt>remote</tt></em></i></dt><dd>Name of the file to retrieve from the remote system.</p></dd><dt><i><em class="replaceable"><tt>local</tt></em></i></dt><dd>Either the new filename on the local system or a filehandle. Ifomitted, the same filename is used.</p></dd></dl></div><a name="INDEX-2301" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>list</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>->list([<em class="replaceable">dir</em>])</pre><p><a name="INDEX-2301" />Lists a directory,<em class="replaceable"><tt>dir</tt></em>, for display. 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.If directory is omitted, defaults to the current directory.</p></div><a name="INDEX-2302" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>login</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>->([<em class="replaceable">login</em>[, <em class="replaceable">passwd</em>[, <em class="replaceable">account</em>]]])</pre><p><a name="INDEX-2302" />Logs user into an FTP server. Argumentsare:</p><dl><dt><i><em class="replaceable"><tt>login</tt></em></i></dt><dd>Login name. If not specified, defaults to<tt class="literal">anonymous</tt> or to the value in<em class="emphasis">$HOME/.netrc</em>.</p></dd><dt><i><em class="replaceable"><tt>passwd</tt></em></i></dt><dd>Password. If not specified, defaults to the user'semail address or to the value in <em class="emphasis">$HOME/.netrc</em>.</p></dd><dt><i><em class="replaceable"><tt>account</tt></em></i></dt><dd>Additional account information for files on the FTP server that havespecial access restrictions.</p></dd></dl></div><a name="INDEX-2303" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>ls</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>->ls([<em class="replaceable">dir</em>])</pre><p><a name="INDEX-2303" />Lists directory,<em class="replaceable"><tt>dir</tt></em>, returning a reference to the list.Defaults to the current working directory.</p></div><a name="INDEX-2304" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>mdtm</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>->mdtm(<em class="replaceable">file</em>)</pre><p><a name="INDEX-2304" />Returns the modification time ofremote file <em class="replaceable"><tt>file</tt></em>.</p></div><a name="INDEX-2305" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>mkdir</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>->mkdir(<em class="replaceable">dir</em>[, <em class="replaceable">recursive</em>])</pre><p><a name="INDEX-2305" />Makes a new directory. Arguments are:</p><dl><dt><i><em class="replaceable"><tt>dir</tt></em></i></dt><dd>The new directory name</p></dd><dt><i><em class="replaceable"><tt>recursive</tt></em></i></dt><dd>If true, creates all directories in the path as needed</p></dd></dl></div><a name="INDEX-2306" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>nlst</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>->nlst([<em class="replaceable">dir</em>])</pre><p><a name="INDEX-2306" />Lists a directory,<em class="replaceable"><tt>dir</tt></em>, for further processing. With noargument, defaults to the current directory. 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-2307" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>pasv</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>->pasv( )</pre><p><a name="INDEX-2307" />Puts server in passive mode.</p></div><a name="INDEX-2308" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>pasv_wait</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>->pasv_wait(<em class="replaceable">server</em>)</pre><p><a name="INDEX-2308" />Waits for a transfer to completebetween a passive and a nonpassive server, in which<em class="replaceable"><tt>server</tt></em> is the Net::FTP object for thenonpassive server.</p></div><a name="INDEX-2309" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>pasv_xfer</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>->pasv_xfer(<em class="replaceable">file1</em>, <em class="replaceable">server</em>, [<em class="replaceable">file2</em>])
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -