Previous: 4.24.2.28. SetDate To the Table of Contents Next: 4.24.2.30. SetFTime
4.24.2.28. SetDate Table of Contents 4.24.2.30. SetFTime

- 4.24.2.29. -
Table of Contents
4. Standard Units
4.24. DOS - MSDOS support unit
4.24.2. DOS Unit Procedures and Functions
4.24.2.29. SetFAttr


4.24.2.29. SetFAttr

Targets: MS-DOS, OS/2, Win32


Dos Unit, WinDos Unit

Sets the attributes of a file.

Declaration:
procedure SetFAttr(var F; Attr: Word);
Remarks:
The file associated with F must be closed. Attr should be formed by ORing 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.

Win32 target:
The file handle must have been created with GENERIC_WRITE access.

Example:
uses
  Dos;
var
  Fi  : File;
  Attr: Word;
begin
  Assign(Fi, 'SECRET.DOC');
  Attr := Hidden or ReadOnly;
  SetFAttr(Fi, Attr);
  WriteLn('SECRET.DOC is now hidden.');
end.
See also:
GetFAttr


Previous: 4.24.2.28. SetDate To the Table of Contents Next: 4.24.2.30. SetFTime
4.24.2.28. SetDate Table of Contents 4.24.2.30. SetFTime

- 4.24.2.29. -