- 4.74.2.18. -
Table of Contents
4. Standard Units
4.74. WinDos - MS-DOS function emulation for OS/2 and Win32
4.74.2. WinDos Unit Procedures and Functions
4.74.2.18. GetFAttr procedure
4.74.2.18. GetFAttr procedure
Targets: MS-DOS, OS/2, Win32
Dos Unit, WinDos Unit
Returns the attributes of a file.
Declaration:
procedure GetFAttr(var F; var Attr: Word);
Remarks:
F is a file variable, either typed, untyped, or text file that is
not open. Attr contains the file attributes.
The file associated with F must be closed. Attr should be
examined by ANDing it with the file attribute constants, which are defined
in the Dos unit.
Errors are reported in DosError, a variable defined in the Dos unit.
For more information about file attributes consult your DOS reference manual.
Example:
uses
WinDos;
var
Fi : Text;
Attr: Word;
begin
Assign(Fi,'THEFILE.DOC');
GetFAttr(Fi, Attr);
if (Attr and ReadOnly) <> 0 then
SetFAttr(Fi,(Attr xor ReadOnly));
end.
See also:
SetFAttr
- 4.74.2.18. -