GetAttr Function

GetAttr (string Pathname)

This function returns an integer that represents the attributes of a file, directory, or folder.

Pathname - This attribute returns the location of a file that includes the drive, the path to the file, and the file's name.

Return Values

The GetAttr function returns the sum of the following attribute values:

Constant Value Description
vbNormal 0 Normal
vbReadOnly 1 Read-only
vbHidden 2 Hidden
vbSystem 4 System file. Not available on the Macintosh.
vbDirectory 16 Directory or folder
vbArchive 32 File has changed since last backup. Not available on the Macintosh.
vbAlias 64 Specified file name is an alias. Available only on the Macintosh.

To determine which attributes are set, you need to use the And operator to perform a bitwise comparison of the value returned by the GetAttr function and the value of the individual file attribute that you want. If the result is not zero, that attribute is set for the named file.

Result = GetAttr(FName) And vbArchive

More:

Example - GetAttr Function