ftp_chdir(3) C Library Calls ftp_chdir(3)NAMEftp_chdir - change current working directory on FTP server
SYNOPSIS
#include <libfget.h>
int ftp_chdir(FTP *ftp, char *dir);
VERSION
This man page documents version 1.3 of libfget.
DESCRIPTION
The ftp_chdir() function changes the current working directory on the
FTP server associated with ftp to dir.
RETURN VALUE
The ftp_chdir() function returns 0 on success, or -1 on error (and sets
errno).
ERRORS
The ftp_chdir() function fails if:
ECONNRESET
The server shut down the connection. The caller is then responā
sible for calling ftp_quit() with the FTP_QUIT_FAST flag set.
ETIMEDOUT
The operation timed out. (The timeout interval can be set via
the FTP_OPT_IO_TIMEOUT option; see the ftp_set_options(3) man
page for details.)
EINVAL Unexpected response code received from server.
EAGAIN An attempt was made to send a request to the server while the
data connection is open.
EACCES The user lacks permission to change to the specified directory.
ENOENT The path specified by dir does not exist (but see NOTES below).
ENOTDIR
The path specified by dir is not a directory (but see NOTES
below).
It may also fail for any of the errors specified for the underlying
poll(2), read(2), or write(2) system calls.
NOTES
Due to limitations in the FTP protocol, the ftp_chdir() function cannot
always tell why a CWD operation has failed. In some cases, it may set
errno to ENOENT, even though the failure may be more accurately
described by ENOTDIR.
SEE ALSOlibfget(3), chdir(2)Feep Networks January 2004 ftp_chdir(3)