FDelete Function

Action

Deletes the specified file.

If the file name includes a directory name, the file is opened in the specified directory. Otherwise, Silk Performer searches for the file in the directory where the test script is located, in the data directory, in the results directory, and in the project directory.

Include file

Kernel.bdh

Syntax

FDelete( in sFileName: string ): boolean;

Return value

  • true if successful

  • false otherwise

Parameter Description
sFileName Name of the file

Example

dcltrans
  transaction TMain
  const
    scFileName := "c:\\temp\\dummyfile.txt";
  var
    hFile: number;
  begin
    // create new file
    FOpen(hFile, scFileName, OPT_FILE_ACCESS_READWRITE, OPT_FILE_CREATE);
    FClose(hFile);
    write("new file created"); writeln;
    // delete file
    FDelete(scFileName);
    write("file deleted"); writeln;
  end TMain;

Output

new file created
file deleted