GetFileAttr

Syntax:

GetFileAttr(Str)

Description:
Returns a string representing the attributes of the specified file.  Although the standard BASIC language contains the GetAttr function to retreive file attributes, this function is superior because the attributes are returned in a format that is human readable and may be used directly in any AML action parameter that supports attribute filters.  Examples of such actions include Copy File and Delete File.

Parameter Description

Str  A text string containing the full path and filename from which the attributes should be extracted.

The return value string is comprised of any combination of the following attribute indicators:

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.

Example:

Sub Main
MsgBox GetFileAttr("c:\foldername\filename.txt")
End
Sub

See Also:

ExtractFileName

ExtractFilePath