Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
GetFAttr Procedure
◄Summary► ◄Details► ◄Example► ◄Back►
Arguments
file_variable Typed, untyped, or text file; assigned, not open
attributes Word variable receiving the current file
attributes
Description
The GetFAttr procedure returns the attributes of a file. DOS
maintains this information in the directory entry for the file.
The file_variable argument must be associated with an unopened
file of any type. Use the Assign procedure to associate a file name
with file_variable.
The attributes argument receives the attribute setting. GetFAttr
sets one or more bits in the argument, representing one or more
attribute values. The Dos unit defines the possible attribute
values as constants. The constant representing a normal file is
Archive.
Use the returned attributes in operations with the predefined
constants, with the plus operator (+), and with AND, OR, and NOT.
For example, to test for a normal file:
GetFAttr( file_variable, attributes );
IF (attributes AND Archive) <> 0
THEN (* the file is a normal file *);
GetFAttr reports error conditions in DosError, defined in the Dos
unit. If no error occurred, GetFAttr sets DosError to 0. Possible
error values are 3, "path not found," and 5, "file access denied."