ftpLogin ftpChdir ftpErrno ftpGetModtime ftpGetSize ftpGet ftpPut ftpBinary ftpPassive ftpVerbose ftpGetURL ftpPutURL ftpLoginAf , ftpGetURLAf , ftpPutURLAf - FTPIO user library
The
ftpLogin ();
function attempts to log in using the supplied
Fa user ,
Fa passwd ,
Fa ftp_port
(if passed as 0,
Fa ftp_port
defaults to the standard ftp port of 21) and
Fa verbose
fields.
If it is successful, a
standard stream descriptor is returned which should be passed to
subsequent FTP operations.
On failure, NULL is returned and
Fa retcode
will have the error code returned by the foreign server.
The
ftpChdir ();
function attempts to issue a server CD command to the directory named in
Fa dir .
On success, zero is returned.
On failure, the error code from the server.
The
ftpErrno ();
function returns the server failure code for the last operation (useful for
seeing more about what happened if you are familiar with FTP error codes).
The
ftpErrString ();
function returns a human readable version of the supplied server failure code.
The
ftpGet ();
function attempts to retrieve the file named by the
Fa file
argument (which is assumed to be relative to the FTP server's current directory,
see
ftpChdir ());
and returns a new FILE* pointer for the file or NULL on failure.
If
Fa seekto
is non-NULL, the contents of the integer it points to will be used
as a restart point for the file, that is to say that the stream
returned will point
Fa *seekto
bytes into the file gotten (this is handy for restarting failed
transfers efficiently).
If the seek operation fails, the value
of
Fa *seekto
will be zero'd.
The
ftpGetModtime ();
function returns the last modification time of the file named by the
Fa file
argument.
If the file could not be opened or stat'd, 0 is returned.
The
ftpGetSize ();
function returns the size in bytes of the file named by the
Fa file
argument.
If the file could not be opened or stat'd, -1 is returned.
The
ftpPut ();
function attempts to create a new file named by the
Fa file
argument (which is assumed to be relative to the FTP server's current directory,
see
ftpChdir ());
and returns a new
Fa stream
pointer for the file or NULL on failure.
The
ftpAscii ();
function sets
ASCII
mode for the current server connection named by
Fa stream .
The
ftpBinary ();
function sets binary mode for the current server connection named by
Fa stream .
The
ftpPassive ();
function sets passive mode (for firewalls) for the current server connection
named by
Fa stream
to boolean value
Fa status .
The
ftpVerbose ();
function sets the verbosity mode for the current server connection named by
Fa stream
to boolean value
Fa status .
The
ftpGetURL ();
function attempts to retrieve the file named by the supplied
Fa URL
and can be considered equivalent to the combined
ftpLogin (,);
ftpChdir ();
and
ftpGet ();
operations except that no server
Fa stream
is ever returned - the connection to the server closes when
the file has been completely read.
Use the lower-level routines
if multiple gets are required as it will be far more efficient.
The
ftpPutURL ();
function attempts to create the file named by the supplied
Fa URL
and can be considered equivalent to the combined
ftpLogin (,);
ftpChdir ();
and
ftpPut ();
operations except that no server stream is ever returned - the connection
to the server closes when the file has been completely written.
Use the
lower-level routines if multiple puts are required as it will be far more
efficient.
The
ftpLoginAf (,);
ftpGetURLAf (,);
ftpPutURLAf ();
functions are same as
ftpLogin (,);
ftpGetURL (,);
ftpPutURL ();
except that they are able to specify address family
Fa af .
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |