Skip to content

StateDMI / Command / RemoveFile


Overview

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

A failure will be generated if the file exists and cannot be removed (e.g., due to file permissions or being locked 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 following dialog is used to edit the command and illustrates the command syntax.

RemoveFile command editor

RemoveFile Command Editor (see also the 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. None – must be specified.
IfNotFound Indicate action if the file is not found, one of:
  • Ignore – ignore the missing file (do not warn).
  • Warn – generate a warning (use this if the file truly is expected and a missing file is a cause for concern).
  • Fail – generate a failure (use this if the file truly is expected and a missing file is a cause for concern).
Ignore

Examples

See the automated tests.

Troubleshooting

See the main troubleshooting documentation

See Also

There are no additional related commands.