If File Exists

Causes the steps following this action to execute if the specified file is in the specified state. If not, execution follows the next Else or End If action, whichever comes first. Wildcard characters (i.e. * or ?) are supported. Used to execute conditional actions based on the state of a file.

The following dataset fields are created only for this action:

Name

Data Type

Return Value

theDataset.Name

Text

The name of the file

theDataset.Size

Number

The size of the file

theDataset.CreatedOn

Date

The file creation date

theDataset.ModifiedOn

Date

The date the file was last modified

theDataset.AccessedOn

Date

The date the file was last accessed

theDataset.IsFolder

Yes/No

Whether the file is a folder

theDataset.IsReadOnly

Yes/No

Whether the file's attribute is Read Only

theDataset.IsArchive

Yes/No

Whether the file's attribute is Archive

theDataset.IsSystem

Yes/No

Whether the file's attribute is System

theDataset.Hidden

Yes/No

Whether the file's attribute is Hidden

theDataset.IsCompressed

Yes/No

Whether the file is compressed

theDataset.IsAccessible

Yes/No

Whether the file is accessible

Declaration

<AMIF ACTION="text(options)" FILE="text" ISNEWERTHAN="date" ATTRFILTER="text" RESULTDATASET="text">

See Also: If, If Compare Files, If Folder Exists, If Last Step, If Pixel Exists, If Process Running, If Text Contains, If Windows Exists, End If, End Select/Case, Goto, Label, Select/Case, Else

General Tab

Property

Type

Required

Default

Markup

Description

If

Text

Yes

Exists

ACTION="not_exist"

Specifies the type of evaluation to be performed. The available options are:

  • File exists: Results to TRUE if the file exists.

  • File does not exist: Results to TRUE if the file does not exist.

  • File is accessible: Results to TRUE if the file exists and is not in a locked state (i.e. in use by another application).

  • File is not accessible: Results to TRUE if the file exists and in a locked state.

File

Text

Yes

(Empty)

a)FILE="c:\folder2\fileA.txt"

b)FILE="c:\folder2\*.txt"

Indicates the full path and file name of the file in which to evaluate. Wildcard characters (i.e. * or ?) are supported.

Create and Populate Dataset with Result Information

Text

No

(Empty)

RESULTDATASET="theData"

Specifies the name of a dataset to be created and populated with the file data for the file that caused the If block to be executed.

About Datasets

Create and populate dataset with ACL info

Text

Yes

(Empty)

RESULTDATASET="myDataset"

Specifies the name of a dataset with which to create and populate the ACL information. This activity creates and populates a dataset containing a specific set of fields.

About Datasets

Advanced Tab

Property

Type

Required

Default

Markup

Description

Exclude Mask

Text

No

(Empty)

EXCLUDE="*.txt"

Causes this action to omit files matching the masks specified. File names or wildcard masks may be used.

Only if Newer Than

Date

No

(Empty)

ISNEWERTHAN=

"%DateSerial(2007,02,01) + TimeSerial(00,00,00)%"

Causes this action to evaluate only files newer than the date/time specified. If this parameter is left blank or not included, the file date will be ignored.

Only if Older Than

Date

No

(Empty)

ISOLDERTHAN=

"%DateSerial(2007,02,01) + TimeSerial(00,00,00)%"

Causes this action to evaluate only files older than the date/time specified. If this parameter is left blank or not included, the file date will be ignored.

Attributes Tab

Property

Type

Required

Default

Markup

Description

Attributes

Text Options

No

(Empty)

ATTRFILTER="+R+A-H" (compress read-only & archive files but not hidden files)

This group of settings causes the action to filter which files to look for based on the attribute settings of the source files. In visual mode, a group of controls are provided to assist in the selection of this parameter. In markup mode, a single text item must be specified that contains the attributes of the files you want to look for.

Available Options:

  • R— Read-only: Specifying "+R" causes files with this attribute turned on to be included, "-R" causes files with this attribute turned off to be included, not specifying the letter (default) causes this attribute to be ignored.

  • A— Archive: Specifying "+A" causes files with this attribute turned on to be included, "-A" causes files with this attribute turned off to be included, not specifying the letter (default) causes this attribute to be ignored.

  • S— System: Specifying "+S" causes files with this attribute turned on to be included, "-S" causes files with this attribute turned off to be included, not specifying the letter (default) causes this attribute to be ignored.

  • H— Hidden: Specifying "+R" causes files with this attribute turned on to be included, "-H" causes files with this attribute turned off to be included, not specifying the letter (default) causes this attribute to be ignored.

  • C— Compression: Specifying "+C" causes files with this attribute turned on to be included, "-C" causes files with this attribute turned off to be included, not specifying the letter (default) causes this attribute to be ignored.

Description Tab

The Description tab allows you to customize the text description of any step as it appears in the Task Builder's Steps Pane.

More on setting custom step description

Error Causes Tab

The Error Causes tab allows you to select/omit specific errors that should cause a particular step to fail.

More on Error Causes

On Error Tab

The On Error tab allows you to determine what the task should do if a particular step encounters an error.

More about On Error properties

Variables and Expressions

All text fields allow the use of expressions, which can be entered by surrounding the expression in percentage signs (Example: %myVariable% or % Left('Text',2)%). To help construct these expressions, you can open Expression Builder from these fields by clicking the percent sign (%) or pressing F2.

More on variables

More on expressions

More on the Expression Builder