Previous: 4.74.2.29. SetDate procedure To the Table of Contents Next: 4.74.2.31. SetFTime procedure
4.74.2.29. SetDate procedure Table of Contents 4.74.2.31. SetFTime procedure

- 4.74.2.30. -
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.30. SetFAttr procedure


4.74.2.30. SetFAttr procedure

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
  WinDos;
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.74.2.29. SetDate procedure To the Table of Contents Next: 4.74.2.31. SetFTime procedure
4.74.2.29. SetDate procedure Table of Contents 4.74.2.31. SetFTime procedure

- 4.74.2.30. -