<< Back


FVSDK_Rename

Synopsis

FVSDK_ERROR_CODE FVSDK_Rename(FVSDK_Session* pSession, LPCTSTR pszOldPathName, LPCTSTR pszNewPathName);

Description

Renames a file or directory. This operation can move a file or directory from one location to another as well. This functionality is dependent on how the server implements the RNFR and RNTO commands.

Parameters

pSession

A pointer to the FVSDK_Session that is to perform the operation.

pszOldPathName

The full path name to the existing file or directory to be renamed.

pszNewPathName

The full path name to the new file or directory.

Return Value

FVSDK_YES if the rename was successful; FVSDK_NO if unsuccessful. Error codes can be found in FVSDK_ErrorCodes.h.

Example

// rename the file
if (FVSDK_Rename(pSession, "/pub/file.txt", "/pub/file.backup.txt") != FVSDK_YES)
    AfxMessageBox("Unable to rename the file.");
    
// or we can move the file
if (FVSDK_Rename(pSession, "/pub/file.txt", "/file.txt") != FVSDK_YES)
    AfxMessageBox("Unable to move the file.");