GetFileAttribs

Description:              This function returns information about the specified file.

Returns:                    Numeric

Usage:                       Script

Format:                      GetFileAttribs(FileName[, Mode] )

Parameters:             FileName  { text }  { required }  { no default }

                                              Any text expression giving the name of the file.

                                    Mode  { Numeric }  { Optional }  { default: 0 }

                                              Optional numeric value that controls what information is returned by this function.

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

1

Timestamp showing the date modified

2

File access and status flags as follows:

0

File is locked or doesn’t exist.

1

Open access (file exists and isn’t open-locked.

2

Read access (bit 0 is always true if this is true).

3

Write access (bit 0 is always true if this is true).

 

Comments:               This function returns a value which is the sum of the following attributes:

Example:

If Watch(0, newFile);

[

  attribs = GetFileAttribs(Concat(MyPath, newFile)); 

]

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

See Also:

SetFileAttribs