Click or drag to resize

GetFAttr Function (DWord)

X#
Convert file attributes to numbers.

Namespace:  XSharp.Core
Assembly:  XSharp.Core (in XSharp.Core.dll) Version: 2.19
Syntax
 FUNCTION GetFAttr(
	uAttributes AS DWORD
) AS DWORD
Request Example View Source

Parameters

uAttributes
Type: DWord
One or more of the following constants or strings:
Character Constant Description
A FC_ARCHIVED Archived
D FA_DIRECTORY Directory
H FC_HIDDEN Hidden
NULL_STRING FC_NORMAL Read/write
R FC_READONLY Read-only
S FC_SYSTEM System
V FA_VOLUME Search for the DOS volume label and exclude all other files
To specify more than one constant, you can either add attributes together, as in FC_SYSTEM + FC_HIDDEN, or use the _Or() operator, as in _Or(FC_SYSTEM, FC_HIDDEN).
To specify more than one string, simply concatenate them, as in "SH."

Return Value

Type: DWord
A number that represents the file attribute specified.
This number could represent two or more file attributes added together.
Remarks
Examples
This example uses GetFAttr() to return file attributes as a number:
X#
1? GetFAttr(FA_DIRECTORY)                // 16
2? GetFAttr(FC_ARCHIVED + FC_READONLY)    // 33
3? GetFAttr("AR")                    // 33
4// Below GetFAttr() converts a string
5// to the required numeric format
6? FFirst("*.txt", GetFAttr("H"))
See Also