|
|
|
|
- Identifying the files attributes
- Modifying the attributes of a file (syntax 2)
- Handling errors
- Operating mode in Windows Vista (and later)
fAttribute (Function) 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 ... END
Syntax
Retrieving the attributes of a file or directory Hide the details
<Result> = fAttribute(<File path>)
<Result>: Character string - "ERR" if an error occurred. To get more details on the error, use ErrorInfo with the errMessage constant.
- One or more letters corresponding to the file attributes ("AH" for example).
The following letters are used:- R: Read-only file. The file can be accessed in read-only.
- H: Hidden file. The file name is grayed or invisible in the explorer.
- S: System file. The file is a Windows system file.
- A: "Archive" file. This attribute indicates that the file can be archived. Some programs use this attribute to determine which files have been saved.
- D: Directory or subdirectory. The file is a directory or a subdirectory.
- C: Compressed file (on the NTFS partitions). This file was automatically compressed during its copy on an NTFS partition (Windows NT or 2000).
- L: Drive. This name corresponds to the volume name of one of the disks accessible from the computer.
<File path>: Character string Name and full (or relative) path of file (up to 260 characters). A UNC path can be used.
Remarks 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 for example. Handling errors 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.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|