LInetFtp::RenameFile
#include "ltwrappr.h"
L_INT LInetFtp::RenameFile(pszOldName, pszNewName)
/* old file name */ | |
/* new file name */ |
Renames a file stored on the FTP server.
Parameter |
Description |
pszOldName |
Character string that contains the name of the file that will have its name changed on the remote FTP server. This is a NULL-terminated string. |
pszNewName |
Character string that contains the new name for the remote file. This is a NULL-terminated string. |
Returns
SUCCESS |
The function was successful. |
< 1 |
An error occurred. Refer to Return Codes. |
Comments
If the file specified in pszNewName already exists, this function will fail.
Required DLLs and Libraries
LTFIL For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application |
See Also
Functions: |
LInetFtp::SendFile, LInetFtp::GetFile, LInetFtp::DeleteFile, Class Members |
Topics: |
|
|
Example
// This example renames a remote file on an FTP server
L_VOID TestFunction(HWND hWndParent, L_TCHAR L_FAR *pszOld,
L_TCHAR L_FAR *pszNew)
{
LInetFtp InetFtp(TEXT("www.leadtools.com"));
// Checking if the connection failed
if(InetFtp.GetErrorFromList()
!= SUCCESS)
{
InetFtp.DisplayError (hWndParent, TEXT("Can't
connect to the FTP server"));
return;
}
if(InetFtp.RenameFile(pszOld,
pszNew) != SUCCESS)
{
InetFtp.DisplayError(hWndParent, TEXT("Can't
rename a remote file, an error within the server"));
return;
}
}