INT RenameFile( |
|
LPCTSTR lpszOldFileName, |
|
|
LPCTSTR lpszNewFileName |
|
); |
The RenameFile method 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
- lpszOldFileName
- Points to a 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 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 method succeeds, the return value is the server result
code. If the method fails, the return value is FTP_ERROR. To get
extended error information, call GetLastError.
Remarks
This method causes two separate commands to be sent to the
server, RNFR and RNTO. If either command fails, the method will fail
and return an error code.
Requirements
Minimum Desktop Platform: Windows 7 (Service Pack 1)
Minimum Server Platform: Windows Server 2008 R2 (Service Pack 1)
Header File: cstools10.h
Import Library: csftpv10.lib
Unicode: Implemented as Unicode and ANSI versions.
See Also
DeleteFile,
GetFile, PutFile
|