int GetFileAttrs (char fileName[], int *readOnly, int *system, int *hidden, int *archive);
Gets the readOnly, system, hidden, and archive attributes of a file.
The readOnly attribute prevents a file from being overwritten and prevents a file with the same name from being created.
The system attribute and hidden attribute prevent the file from appearing in a directory list and exclude the file from normal searches.
The archive attribute is set whenever the file is modified. The DOS backup command clears the archive attribute.
If you pass a directory instead of a file, GetFileAttrs returns 1.
![]() |
Note If you do not set any of the attributes, the file is a normal file and can be read or written without restriction. |
/* Get the attributes of WAVEFORM.DAT. */
int read_only, system, hidden, archive;
GetFileAttrs ("WAVEFORM.DAT",&read_only, &system, &hidden, &archive);
if (read_only)
FmtOut ("WAVEFORM.DAT is a read-only file!"");
Input | ||
Name | Type | Description |
fileName | string | The pathname of the file for which to get the attributes. If you specify an empty string "", GetFileAttrs uses the file found by the most recent call to GetFirstFile or GetNextFile. |
Output | ||
Name | Type | Description |
readOnly | integer | The state of the readOnly attribute. Values 1—Attribute set. 0—Attribute cleared. |
system | integer | The state of the system attribute. Values 1—Attribute set. 0—Attribute cleared. |
hidden | integer | The state of the hidden attribute. Values 1—Attribute set. 0—Attribute cleared. |
archive | integer | The state of the archive attribute. Values 1—Attribute set. 0—Attribute cleared. |
Name | Type | Description | ||||||||
result | integer | The result of the call.
|