Folder.DeleteTree

Folder.DeleteTree (

string FolderName,

function CallbackFunction = nil )

Description

Deletes a folder and all of its contents (files and subfolders) from the user's system.

Parameters

FolderName

(string) The path to the folder.

CallbackFunction

(function) The name of a function that will be called whenever progress is made in the delete operation. (You can use this callback function to display the progress of the delete 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 deleted.

Deleted

(number) The number of files deleted so far.

Total

(number) The total number of files that will be deleted.

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

VALUE

DESCRIPTION

true

Continue with the delete operation.

false

Stop the delete operation as soon as possible.

Returns

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

See also: Related Actions