- Identifying the files attributes
- Modifying the attributes of a file (syntax 2)
- Handling errors
- Operating mode in Windows Vista (and later)
In french: fAttribut
Returns or modifies the attributes of a file.
// Retrieve the attributes of a file
ResAttribute = fAttribute(FilePath + "\File.txt")
IF ResAttribute <> "ERR" THEN
Retrieving the attributes of a file or directory Hide the details
<Result> = fAttribute(<File path>)
Identifying the files attributes
To retrieve the different attributes of a file, check whether one of the letters identifying an attribute is found in <Result>. This search can be performed by Position
fAttribute throws an error in the following cases:
- the specified file does not exist,
- the name of the specified file is invalid,
- the specified file is opened or locked by another application (when modifying the attributes only),
- the letters specified in <File attributes> do not correspond to file attributes.
Operating mode in Windows Vista (and later)
If this function does not operate properly in Windows Vista (and later), check whether the file or directory used is not in one of the system directories (Windows directory or "Program Files" directory).
In Windows Vista (and later), with the UAC mechanism (User Account Control) enabled
, you must have administrator privileges to handle and/or modify the files or directories in system directories (Windows directory or "Program Files" directory).
Programming tip: To handle and/or modify the files or directories without administrator privileges, you should:
- avoid writing to the Windows directory or to the "Program Files" directory,
- use the system directory of the application (returned by SysDir with the srAppDataCommun constant, for example).
This page is also available for…