Skip to content

TSTool / Command / RemoveFile


Overview

The RemoveFile command removes a file from the file system. The command is used to remove results files before attempting to regenerate the results and is used extensively in software testing.

A failure will be generated if the file exists and cannot be removed (e.g., due to file permissions or because the file is being used by another process).

Even read-only files may be removed by this command, depending on how the operating system and computer environment handle access permissions.

Command Editor

The command is available in the following TSTool menu:

  • Commands / General - File Handling

The following dialog is used to edit the command and illustrates the command syntax.

RemoveFile command editor

RemoveFile Command Editor (see full-size image)

Command Syntax

The command syntax is as follows:

RemoveFile(Parameter="Value",...)

Command Parameters

Parameter                           Description Default          
InputFile
required
The name of the file to delete. Can be specified using ${Property}. None - must be specified.
IfNotFound Indicate an action if the source file is not found:
  • Ignore - ignore the missing file and do not warn
  • Warn - generate a warning message
  • Fail - generate a failure message
Warn

Examples

See the automated tests.

Troubleshooting

See the main TSTool Troubleshooting documentation.

See Also