GetFileAttribs
Description: |
Returns information about the specified file. |
Returns: |
Numeric |
Usage: |
Script only. |
Function Groups: |
File I/O |
Related to: |
SetFileAttribs |FileFind | Dir |
Format: |
GetFileAttribs(FileName[, Mode] ) |
Parameters: |
|
FileName |
Required. Any text expression giving the name of the file. A known path Known Path Aliases for File-Related Functions may be provided in the form, :{KnownPathAlias}. |
Mode |
Optional numeric value that controls what information is returned by this function. Defaults to 0 if missing or invalid.Mode: | Function Returns: |
---|
0 | File attributes in the form of a value set to the sum of the following values: Value | Bit No. | Attribute |
---|
0 | - | Normal | 1 | 0 | Read only | 2 | 1 | Hidden | 4 | 2 | System | 8 | 3 | Archive | 16 | 4 | Directory |
| 1 | Timestamp showing the date modified | 2 | File access and status flags as follows: 0 | File is locked or doesn’t exist. | 1 | Open access (file exists and isn’t open-locked. | 2 | Read access (bit 0 is always true if this is true). | 3 | Write access (bit 0 is always true if this is true). |
|
|
Comments: |
The return value will vary according to Mode. See tables above. |
Example:
If Watch(0, newFile);
[
attribs = GetFileAttribs(Concat(MyPath, newFile));
]
The above statement will cause attribs to be set to the file attribute value of newFile every time its name changes.
Trihedral and VTScada are registered trade marks of Trihedral Engineering Limited
© Trihedral Engineering Limited 1983- 2022 All rights reserved.