Click or drag to resize

FAttrib Function

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

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

Return Value

Type: DWord
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:
ConstantDescription
FA_DIRECTORY Directory
FA_VOLUME Vorume
FC_HIDDEN Hidden
FC_NORMAL Visible
FC_SYSTEM System

ConstantDescription
FC_ARCHIVED Archived file
FC_HIDDEN Hidden file
FC_NORMAL Normal read/write file
FC_READONLY Read-only file
FC_SYSTEM System file
Tip Tip
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