FMOVE

Concept Link IconSee also Concept Link IconExample

Move a file from source to destination.

WebVue support - Yes.

Syntax

IntVal = FMOVE (ExistingFileName, NewFileName[, AllowOverwrite]);

Argument

Meaning

ExistingFileName

The name and optional path of the source file. Type STR.
If executed in a WebVue session context this instruction is processed by the computer that hosts the web back end and the referenced file is on that computer.

NewFileName The name and optional path of the destination file. Type STR.
If executed in a WebVue session context this instruction is processed by the computer that hosts the web back end and the referenced file is on that computer.
AllowOverwrite A flag to allow overwrite of a file of the same name.
0 = Do not allow (default).
1 = Allow.

Execution

Move the specified file. The optional AllowOverwrite flag can be used to permit an existing file of the same name to be overwritten.

Return:
1 - Successful.
0 - Failed. The source file does not exist or it is opened and locked by another application.
-1 - Failed. The destination file already exists and AllowOverwrite is set to 0.
-2 - Failed. The source file is already opened by SCADA Basic (Fopen).

Further Information

The ExistingFileName and NewFileName can be either just a file name or include a full or a relative path. If a path is not included, the operation takes place within the project's TP folder. If you include a path in the NewFileName and the folder does not exist, it will be created.

Examples

FileName

Example

File name MyFile.dat
With full path C:\\temp\\MyFile.dat
With relative path ..\\..\\Files\\MyFile.dat

Note the requirement to use a double slash as the folder separator.