?? ftplib.html
字號:
close (dataSock); if (nBytes < 0) /* read error? */ status = ERROR; if (ftpReplyGet (ctrlSock, TRUE) != FTP_COMPLETE) status = ERROR; if (ftpCommand (ctrlSock, "QUIT", 0, 0, 0, 0, 0, 0) != FTP_COMPLETE) status = ERROR; close (ctrlSock);</pre></blockquote><h4>RETURNS</h4><blockquote><p><p>OK, or ERROR if any socket cannot be created or if a connection cannot bemade.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ftpLib.html#top">ftpLib</a></b>, <b><i><a href="./ftpLib.html#ftpReplyGet">ftpReplyGet</a></i>( )</b><hr><a name="ftpReplyGet"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>ftpReplyGet</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>ftpReplyGet</i>( )</strong> - get an FTP command reply</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int ftpReplyGet ( int ctrlSock, /* control socket fd of FTP connection */ BOOL expecteof /* TRUE = EOF expected, FALSE = EOF is error */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine gets a command reply on the specified control socket.All the lines of a reply are read (multi-line replies areindicated with the continuation character "-" as the fourth characterof all but the last line).<p>The three-digit reply code from the first line is saved and interpreted.The left-most digit of the reply code identifies the type of code(see RETURNS below).<p>The caller's error status is set to the complete three-digit reply code(see the manual entry for <b><i><a href="./errnoLib.html#errnoGet">errnoGet</a></i>( )</b>).If the reply code indicates an error, the entire replyis printed on standard error.<p>If an EOF is encountered on the specified control socket, but no EOF wasexpected (<i>expecteof</i> == FALSE), then ERROR is returned.<p></blockquote><h4>RETURNS</h4><blockquote><p><p> 1 = <b>FTP_PRELIM</b> (positive preliminary)<br> 2 = <b>FTP_COMPLETE</b> (positive completion)<br> 3 = <b>FTP_CONTINUE</b> (positive intermediate)<br> 4 = <b>FTP_TRANSIENT</b> (transient negative completion)<br> 5 = <b>FTP_ERROR</b> (permanent negative completion)<p>ERROR if there is a read/write error or an unexpected EOF.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ftpLib.html#top">ftpLib</a></b><hr><a name="ftpHookup"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>ftpHookup</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>ftpHookup</i>( )</strong> - get a control connection to the FTP server on a specified host</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int ftpHookup ( char * host /* server host name or inet address */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine establishes a control connection to the FTP server on thespecified host. This is the first step in interacting with a remote FTPserver at the lowest level. (For a higher-level interaction with a remoteFTP server, see the manual entry for <b><i><a href="./ftpLib.html#ftpXfer">ftpXfer</a></i>( )</b>.)<p></blockquote><h4>RETURNS</h4><blockquote><p><p>The file descriptor of the control socket, or ERROR if the Internetaddress or the host name is invalid, if a socket could not be created, orif a connection could not be made.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ftpLib.html#top">ftpLib</a></b>, <b><i><a href="./ftpLib.html#ftpLogin">ftpLogin</a></i>( )</b>, <b><i><a href="./ftpLib.html#ftpXfer">ftpXfer</a></i>( )</b><hr><a name="ftpLogin"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>ftpLogin</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>ftpLogin</i>( )</strong> - log in to a remote FTP server</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS ftpLogin ( int ctrlSock, /* fd of login control socket */ char * user, /* user name for host login */ char * passwd, /* password for host login */ char * account /* account for host login */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine logs in to a remote server with the specified user name,password, and account name, as required by the specific remote host. Thisis typically the next step after calling <b><i><a href="./ftpLib.html#ftpHookup">ftpHookup</a></i>( )</b> in interacting with aremote FTP server at the lowest level. (For a higher-level interactionwith a remote FTP server, see the manual entry for <b><i><a href="./ftpLib.html#ftpXfer">ftpXfer</a></i>( )</b>).<p></blockquote><h4>RETURNS</h4><blockquote><p><p>OK, or ERROR if the routine is unable to log in.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ftpLib.html#top">ftpLib</a></b>, <b><i><a href="./ftpLib.html#ftpHookup">ftpHookup</a></i>( )</b>, <b><i><a href="./ftpLib.html#ftpXfer">ftpXfer</a></i>( )</b><hr><a name="ftpDataConnInit"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>ftpDataConnInit</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>ftpDataConnInit</i>( )</strong> - initialize an FTP data connection</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int ftpDataConnInit ( int ctrlSock /* fd of associated control socket */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine sets up the client side of a data connection for thespecified control connection. It creates the data port, informs theremote FTP server of the data port address, and listenson that data port. The server will then connect to this data portin response to a subsequent data-transfer command sent on thecontrol connection (see the manual entry for <b><i><a href="./ftpLib.html#ftpCommand">ftpCommand</a></i>( )</b>).<p>This routine must be called <i>before</i> the data-transfer command is sent;otherwise, the server's connect may fail.<p>This routine is called after <b><i><a href="./ftpLib.html#ftpHookup">ftpHookup</a></i>( )</b> and <b><i><a href="./ftpLib.html#ftpLogin">ftpLogin</a></i>( )</b> to establish aconnection with a remote FTP server at the lowest level. (For ahigher-level interaction with a remote FTP server, see <b><i><a href="./ftpLib.html#ftpXfer">ftpXfer</a></i>( )</b>.)<p></blockquote><h4>RETURNS</h4><blockquote><p>The file descriptor of the data socket created, or ERROR.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ftpLib.html#top">ftpLib</a></b>, <b><i><a href="./ftpLib.html#ftpHookup">ftpHookup</a></i>( )</b>, <b><i><a href="./ftpLib.html#ftpLogin">ftpLogin</a></i>( )</b>, <b><i><a href="./ftpLib.html#ftpCommand">ftpCommand</a></i>( )</b>, <b><i><a href="./ftpLib.html#ftpXfer">ftpXfer</a></i>( )</b><hr><a name="ftpDataConnGet"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>ftpDataConnGet</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>ftpDataConnGet</i>( )</strong> - get a completed FTP data connection</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int ftpDataConnGet ( int dataSock /* fd of data socket on which to await connection */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine completes a data connection initiated by a call to<b><i><a href="./ftpLib.html#ftpDataConnInit">ftpDataConnInit</a></i>( )</b>. It waits for a connection on the specified socket fromthe remote FTP server. The specified socket should be the one returned by<b><i><a href="./ftpLib.html#ftpDataConnInit">ftpDataConnInit</a></i>( )</b>. The connection is established on a new socket, whosefile descriptor is returned as the result of this function. The original socket, specified in the argument to this routine, is closed.<p>Usually this routine is called after <b><i><a href="./ftpLib.html#ftpDataConnInit">ftpDataConnInit</a></i>( )</b> and <b><i><a href="./ftpLib.html#ftpCommand">ftpCommand</a></i>( )</b> toinitiate a data transfer from/to the remote FTP server.<p></blockquote><h4>RETURNS</h4><blockquote><p><p>The file descriptor of the new data socket, or ERROR if the connectionfailed.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ftpLib.html#top">ftpLib</a></b>, <b><i><a href="./ftpLib.html#ftpDataConnInit">ftpDataConnInit</a></i>( )</b>, <b><i><a href="./ftpLib.html#ftpCommand">ftpCommand</a></i>( )</b><hr><a name="ftpLs"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>ftpLs</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>ftpLs</i>( )</strong> - list directory contents via FTP</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS ftpLs ( char * dirName /* name of directory to list */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine lists the contents of a directory. The content listis obtained via an NLST FTP transaction.<p>The local device name must be the same as the remote host namewith a colon ":" as a suffix. (For example "wrs:" is the devicename for the "wrs" host.)<p></blockquote><h4>RETURNS </h4><blockquote><p>OK, or ERROR if could not open directory.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ftpLib.html#top">ftpLib</a></b></body></html>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -