.TH ftp_rename 3 "January 2004" "Feep Networks" "C Library Calls" .SH NAME ftp_rename \- rename a file on an FTP server .SH SYNOPSIS .B #include .BI "int ftp_rename(FTP *" ftp ", char *" oldname "," .BI "char *" newname ");" .SH VERSION This man page documents version 1.3 of \fBlibfget\fP. .SH DESCRIPTION The \fBftp_rename\fP() function will rename a file on the FTP server associated with \fIftp\fP named \fIoldname\fP to the name \fInewname\fP. .SH RETURN VALUE The \fBftp_rename\fP() function returns 0 on success, or -1 on error (and sets \fIerrno\fP). .SH ERRORS The \fBftp_rename\fP() function fails if: .TP .B ECONNRESET The server shut down the connection. The caller is then responsible for calling \fBftp_quit\fP() with the \fBFTP_QUIT_FAST\fP flag set. .TP .B ETIMEDOUT The operation timed out. (The timeout interval can be set via the \fBFTP_OPT_IO_TIMEOUT\fP option; see the \fBftp_set_options\fP(3) man page for details.) .TP .B EINVAL Unexpected response code received from server. .TP .B EAGAIN An attempt was made to send a request to the server while the data connection is open. .TP .B ETXTBUSY The file specified by \fIoldname\fP is busy. .TP .B ENOENT The file specified by \fIoldname\fP does not exist. .TP .B EACCES The user does not have permission to rename the specified file. .PP It may also fail for any of the errors specified for the underlying \fBpoll\fP(2), \fBread\fP(2) or \fBwrite\fP(2) system calls. .SH SEE ALSO .BR libfget (3), .BR rename (2)