FileSystem.Copy(String, String, Variable, Variable) Method

Top 

Description

Copies the specified file or directory sourcePath to file or directory destinationPath. When copying a directory, all files and subfolders will be copied recursively.

 

If sourcePath does not exist, an error will be reported. If sourcePath and destinationPath are the same files, an error will be reported. If either sourcePath or destinationPath is not a regular file or directory, an error will be reported. If sourcePath is a directory, but destinationPath is a regular file, an error will be reported. An error will be reported if the copy operation is unsuccessful.

 

Timing Precision Mode

This page describes functionality in millisecond timing precision mode. Millisecond timing precision mode is deprecated and will be removed in a future release. We recommend that you migrate your Mission Plans to nanosecond timing precision mode.

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

 

Method Signature

FileSystem.Copy(

String sourcePath,


String destinationPath,


Variable overwrite,


Variable followLinks)

 

 

Arguments

sourcePath


Description:

The source file or directory to be copied. When copying a directory, all files and subfolders will be copied recursively.

 

 

destinationPath


Description:

The destination file or directory to which the source will be copied. destinationPath must be the same type as the sourcePath.

 

 

overwrite


Description:

A flag which determines whether the copy operation should overwrite existing files. If this is false, an error will be reported if the destination already exists.

Valid Values:

Value

Label

0

false

1

true

 

 

 

followLinks


Description:

A flag which determines whether the copy operation will follow symlinks, or copy the symlink itself.

Valid Values:

Value

Label

0

false

1

true

 

 

 

 

Syntax

FileSystem.Copy(myString1, myString2, myVariable1, myVariable2);

 

 

See also

FileSystem Object

FileSystem.Copy

Interfacing with Files Guide