IFileSystemInfo.Delete

Syntax

Delete;

Description

The Delete method deletes a file.

Example

Sub UserProc;
Var
    FileSInfo: IFileSystemInfo;
Begin
    FileSInfo:=New FileInfo.Attach("c:\1.txt");
    If FileSInfo.Exists Then
        FileSInfo.Delete;
    End If;
Dispose FileSInfo;
End Sub UserProc;

After executing the example the 1.txt file is deleted if it exists.

See also:

IFileSystemInfo