File.Move

File.Move ( 

string   Source,

string   Destination,

boolean  Recurse = true,

boolean  Overwrite = true,

boolean  AbortOnFail = false,

boolean  IncludeHiddenFiles = false,

function CallbackFunction = nil )

Description

Moves a file to another location.

Parameters

Source

(string) The path to the file that you want to move. You can use the * and ? wildcards in this field to move multiple files.

Destination

(string) The path to the destination folder or file that you want to move to.

Warning: Any folders in the destination path must already exist when performing this action, or an error will result.

Tip: You can use a Folder.Create action to create a destination folder if necessary.

Recurse

(boolean) Whether to recurse through subfolders when a wildcard is used in the Source parameter:

VALUE

DESCRIPTION

true

Recurse. (Default)

false

Don't recurse.

Overwrite

(boolean) Whether to overwrite any files in the destination folder if they have the same names as the files being moved:

VALUE

DESCRIPTION

true

Move the source files right over the destination files. (Default)

false

Don't move a file if another file with the same name already exists in the destination folder.

AbortOnFail

(boolean) Whether to abort the move operation if an error occurs:

VALUE

DESCRIPTION

true

Stop moving as soon as the first error occurs.

false

Continue moving files even if some files fail to move. (Default)

IncludeHiddenFiles

(boolean) Whether to move files that have the "hidden" or "system" attributes set:

VALUE

DESCRIPTION

true

Move files even if they have the "hidden" or "system" attributes set.

false

Don't move any files that have the "hidden" or "system" attributes set. (Default)

CallbackFunction

(function) The name of a function that will be called whenever progress is made in the move operation. (You can use this callback function to display the progress of the move operation in your own custom way.)

Note: If CallbackFunction is set to nil, then the progress information will be sent to the built-in status dialog, assuming it is currently visible. (You can show or hide the status dialog with a StatusDlg.Show or StatusDlg.Hide action.)

The callback function must be able to receive the following parameters:

Source

(string) The source path of the file being copied.

Destination

(string) The destination path for file being copied.

Copied

(number) The number of bytes copied so far.

Total

(number) The total bytes that will be copied.

FileCopied

(number) The number of bytes of the current file moved so far.

FileTotal

(number) The current file's total bytes that will be moved.

The callback function should return a boolean value (true or false) indicating whether the move application should continue:

VALUE

DESCRIPTION

true

Continue with the move operation.

false

Stop the move operation as soon as possible.

Returns

Nothing. You can use Application.GetLastError to determine whether this action failed, and why.

See also:  Related Actions