FileAttrGet

Returns file attributes.

Syntax:

FileAttrGet (filename)

Parameters:

(s) filename file whose attributes you want to determine.

Returns:

(s) attribute settings.

 

Returns attributes for the specified file, in a string of the form "RASH". This string is composed of four individual attribute characters, as follows:

Symbol Meaning

Symbol Meaning

R read only ON
A archive ON
S system ON
H hidden ON

- read only OFF
- archive OFF
- system OFF
- hidden OFF

A hyphen in any of these positions indicates that the specified attribute is OFF. For example, the string "-A-H" indicates a file which has the Archive and Hidden attributes set.

This function supports extended-length path names.

Example:


editfile = StrCat(DirWindows(0),"win.ini")
attr = FileAttrGet(editfile)
If StrSub(attr, 1, 1) == "R"
   Message("File is read-only", "Cannot edit %editfile%")
Else
   DirChange(DirWindows(0))
   Run("notepad.exe", editfile)
EndIf
See Also:

FileAttrSet, FileAttrGetEx, FileTimeGet, FileInfoToArray