GetFileAttribs

(Engine-Level Function)

Description: Returns information about the specified file.
Returns: Numeric
Usage: Script only.
Function Groups: File I/O
Related to: SetFileAttribs |FileFind | Dir
Format: GetFileAttribs(FileName[, Mode] )
Parameters:  
FileName
Required. Any text expression giving the name of the file. A known path Known Path Aliases for File-Related Functions may be provided in the form, :{KnownPathAlias}.
Mode

Optional numeric value that controls what information is returned by this function. Defaults to 0 if missing or invalid.

(See: Bitwise Parameters & Operations)

Mode:

Function Returns:

0

File attributes in the form of a value set to the sum of the following values:

Value

Bit No.

Attribute

0

-

Normal

1

0

Read only

2

1

Hidden

4

2

System

8

3

Archive

16

4

Directory

1

Timestamp showing the date modified (local)

2

File access and status flags as follows:

Value

Bit No.

Attribute

1

0

Open access (i.e. the file exists and is not open-locked)

2

1

Read access (i.e. the file can be read)

4

2

Write access (i.e. the file can be written)

3 Timestamp showing the date modified (UTC)
Comments: The return value will vary according to Mode. See tables above.

Example:

  If StrictlyNotEqual(NewFile, OldFile);
  [
    Attribs = GetFileAttribs(Concat(MyPath, NewFile));
    OldFile = NewFile;
  ]

The above statement will cause Attribs to be set to the file attribute value of NewFile every time its name changes.