You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

This action allows you to check for the existence of a specific file or folder.

You can choose to fail the action if the file or folder exists, or if the file or folder is missing, or not to fail at all. You can also choose a variable to set. Its value will be set to "True" if the file or folder exists, or "False" otherwise.

When using the Do not fail option, you should specify a variable to hold the result of the file check.

Details

Options

File spec or folder name

Fileset

Fail action if 

File or folder is missing

File or folder exists 

Do not fail

Set variable

 

Examples

File must be present

  1. A critical file must be present:
  2. Specify the name of the file.
  3. On the Details tab, choose Fail Action If - File or Folder is Missing.
  4. Do not specify a variable.

The build will immediately abort if the required file is missing.

Warn user folder contains files

The user should be warned if any files are present in a directory.

  1. Specify a path and a file mask, such as c:\builds\Output\*.*
  2. On the Details tab, choose Fail Action If - File or Folder is Missing.
  3. On the Runtime tab, select Fail Action If - Do not fail.
  4. Create a (nested) sub-node with the required warning behaviour.

The build will skip the sub-node if the file is not present, but will keep running.

Presences of file

Complex logic involving the presence of a file:

  1. Specify the name of the file.
  2. Choose "Do not Fail"
  3. Specify the name of a variable which will indicate the presence of the file.
  4. In a later "If...Then" step, use the name of the variable.

"True" indicates that the file exists. "False" indicates that the file does not exist.

  • No labels