IFile.Move

Syntax

Move(Source: String; Destination: String);

Parameters

Source. Path to the file to be moved.

Destination. Path to the folder, to which a file will be moved.

Description

The Move method moves a file.

Comments

The method moves the Source file to the Destination folder. If the file already exists in the folder, it will be overwritten.

Example

Executing the example requires the C:\New_folder\1.txt file and the C:\Temp folder.

Add links to the Fore and IO system assemblies.

Sub UserProc;
Begin
    // If file or folder exist, move the file
    If File.Exists("c:\New_folder\1.txt"And Directory.Exists("c:\Temp"Then
        File.Move("c:\New_folder\1.txt""c:\Temp");
    End If;
End Sub UserProc;

After executing the example, the 1.txt file will be moved to the C:\Temp folder.

See also:

IFile