-
-
Notifications
You must be signed in to change notification settings - Fork 4
SSH.SFTPSession.Rename
SSH.SFTPSession.Rename
Sub Rename(SourceName As String, DestinationName As String, Overwrite As Boolean = False)
Function Rename(SourceName As String, DestinationName As String, Overwrite As Boolean = False) As String
Function Rename(SourceName As String, DestinationName As String, Overwrite As Boolean, Atomic As Boolean, SysCalls As Boolean) As String
Name | Type | Comment |
---|---|---|
SourceName |
String | The path to the remote file to be renamed. |
DestinationName |
String | The new path for the file. |
Overwrite |
Boolean | Optional. If True, the destination file will be overwritten if it exists. |
Name | Type | Comment |
---|---|---|
SourceName |
String | The path to the remote file to be renamed. |
DestinationName |
String | The new path for the file. |
Overwrite |
Boolean | If True, the destination file will be overwritten if it exists. |
Atomic |
Boolean | If True, the server is requested to perform an atomic rename operation. |
Syscalls |
Boolean | If True, the server is requested to perform the rename using native system calls. |
The version that returns a string will return the normalized DestinationName
on success, and the normalized SourceName
on error.
Renames the specified file or directory on the remote server using SFTP. Check SFTPSession.LastError to determine whether the rename operation succeeded.
A "normalized" path is one that has been transformed to comply with SFTP's conventions, for example by prepending the WorkingDirectory
string if the original input appears to be a relative path.
The normalized DestinationName
may be used in subsequent operations to refer to the renamed file. The normalized SourceName
is the literal string value of the path as it was sent over the wire, which may be useful in case of error.
Wiki home | Project page | Bugs | Become a sponsor
Text and code examples are Copyright ©2018-24 Andrew Lambert, offered under the CC BY-SA 3.0 License.