Back to product page

Rename method


Renames file or directory on the server.

Type

Void

Syntax

  • C#
  • VB.NET
public Void Rename(String NewRemotePath);
The Rename(NewRemotePath) syntax has these parts:
NewRemotePathFull path to new file/directory name.

public Void Rename(String NewRemotePath, String OldRemotePath);
The Rename(NewRemotePath,OldRemotePath) syntax has these parts:
NewRemotePathFull path to new file/directory name.
OldRemotePathFull path to old file/directory name.

public Sub Rename(ByVal NewRemotePath As String)
The Rename(NewRemotePath) syntax has these parts:
NewRemotePathFull path to new file/directory name.

public Sub Rename(ByVal NewRemotePath As String, ByVal OldRemotePath As String)
The Rename(NewRemotePath,OldRemotePath) syntax has these parts:
NewRemotePathFull path to new file/directory name.
OldRemotePathFull path to old file/directory name.

Remarks

This method will rename file or directory in remote server, if possible. Once completed, Done event will be fired. If no error occurs, Args.Error argument in Done event will be set to null (Nothing in VB). If error occurred, Args.Error will contain info about the error.

If you don't specify OldRemotePath argument, then wodFtpDLX.NET will use value of RemotePath property for this method.

Even UNIX (and windows in last few versions) have same command for renaming and moving (which is in fact MOVE command), you cannot be sure that this command will also move files from one directory to another. This depends only on server-side implementation of FTP and SFTP protocols.

No wildcards can be used for RemotePath argument. RFC protocol specifications for FTP and FTP do not allow them.

Platforms

Windows