Function FAttr() Foundation
Retrieves or modifies file attributes.
FAttr( <cFileName>, [<cAttribute>] ) --> cFileAttributes
The function returns a string containing the attributes set for a file. Each character in the returned string represents one file attribute according to the following table.
Attribute | Meaning | Description |
---|---|---|
D | Directory | File is a directory |
H | Hidden | Hidden file |
S | System | File is part of the operating system |
R | Read-only | File cannot be overwritten |
A | Archive | File will be included in backups |
N | Normal *) | File has no other attibutes |
C | Compressed *) | File is stored compressed |
|
The function can be used to retrieve the current attributes of a file or to modify these.
// The example demonstrates how to set and remove
// file attributes
#include "Directry.ch"
PROCDURE Main
LOCAL aDir := Directory( "*.*" )
// Setting file attributes
AEval( aDir, {|a| FAttr( a[F_NAME], "R" ) } )
WAIT "Read-only attribute set"
AEval( aDir, {|a| FAttr( a[F_NAME], "+H" ) } )
WAIT "Hidden attribute set"
// Removing file attributes
AEval( aDir, {|a| FAttr( a[F_NAME], "-R-H" ) } )
WAIT "Attributes removed"
RETURN
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.