Click or drag to resize

FAttrib Function

Determine the attributes of the file found after FFCount(), FFirst(), or FNext().

Namespace:  XSharp.Core
Assembly:  XSharp.Core (in XSharp.Core.dll) Version: 2.6
Syntax
 FUNCTION FAttrib() AS DWORD
Request Example View Source

Return Value

Type: UInt32
A value indicating the attributes of the current file. The constants in the following table can be used individually or added together to determine which attributes are applicable: Constant Description FA_DIRECTORY Directory FA_VOLUME Volume FC_ARCHIVED Archived FC_HIDDEN Hidden FC_NORMAL Read/write FC_READONLY Read-only FC_SYSTEM System Note:
It is not uncommon for a file to have more than one attribute.
For example, it may be read-only and archived, which would be represented as FC_READONLY + FC_ARCHIVED or _Or(FC_READONLY, FC_ARCHIVED).
Remarks
Since FFCount() and FFirst() cannot distinguish files based on their read and archive attributes, FAttrib() can be useful in determining these attributes.
For example, if FAttrib() returns FC_NORMAL, you know that the current file is read/write and not archived, and if it is FC_ARCHIVED (or FC_NORMAL + FC_ARCHIVED), you know the file is read/write and archived.
Examples
This example uses FAttrib() in conjunction with FFirst() and FNext():
X#
1// Find the first file matching docu*.txt
2? FFirst("docu*.txt", FC_NORMAL)
3? FAttrib()            //  32 (FC_ARCHIVED)
4? FNext()                // Next file matching docu*.txt
5? FAttrib()            //  33
6// 33 is FC_READONLY + FC_ARCHIVED
See Also