| INT WINAPI FtpRenameFile(
|
| |
HCLIENT hClient, |
|
| |
LPCTSTR lpszOldFileName, |
|
| |
LPCTSTR lpszNewFileName |
|
| );
|
The FtpRenameFile function renames the specified file on
the server. The file must exist, and the current user must have the
appropriate permission to change the file name.
Parameters
- hClient
- Handle to the client session.
- lpszOldFileName
- Points to a null-terminated string that specifies the name of
the remote file to rename. The file pathing and name conventions
must be that of the server.
- lpszNewFileName
- Points to a null-terminated string the specifies the new name
for the remote file. The file pathing and name conventions must be
that of the server.
Return Value
If the function succeeds, the return value is the server result
code. If the function fails, the return value is FTP_ERROR. To get
extended error information, call FtpGetLastError.
Remarks
This function causes two separate commands to be sent to the
server, RNFR and RNTO. If either command fails, the function will
fail and return an error code.
Requirements
Client: Requires Windows 7, Windows Vista or Windows
XP.
Server: Requires Windows Server 2008 or Windows Server
2003.
Header: Include cstools7.h.
Library: Use csftpav7.lib.
Unicode: Implemented as Unicode and ANSI versions.
See Also
FtpDeleteFile, FtpGetFile, FtpPutFile
|