FileSystem.Rename(String, String, Variable) Method

Top 

Description

Renames the specified file or directory sourcePath to the destinationPath. When moving a directory, all files and subfolders will be renamed, recursively. In the event that the rename operation overwrites existing files or directories, the rename is not atomic. An error will be reported if the rename operation is unsuccessful.

 

Timing Precision Mode

This page describes functionality in nanosecond timing precision mode.

Click here to see the documentation for this object in millisecond timing precision mode.

 

Method Signature

FileSystem.Rename(

String sourcePath,


String destinationPath,


Variable overwrite)

 

 

Arguments

sourcePath


Description:

The source file or directory which is to be renamed.

 

 

destinationPath


Description:

The destination file or directory to which the source will be renamed. destinationPath and sourcePath must be of the same type.

 

 

overwrite


Description:

A flag which determines if the rename operation can overwrite existing files or directories. If this is false, an error will be reported if the destination already exists. If this is true, the rename operation is not atomic.

Valid Values:

Value

Label

0

false

1

true

 

 

 

 

Syntax

FileSystem.Rename(myString1, myString2, myVariable1);

 

 

See also

FileSystem Object

FileSystem.Rename

Interfacing with Files Guide