SetAttributes(FileName: String; Attributes: FileAttributes);
FileName - a path and name of the file, attribute of which should be changed.
Attributes - file attributes that should be set.
The GetAttributes method changes attributes of a file passed by the parameter FileName. List of attributes is separated with operator Or.
Sub Main;
Begin
If File.Exists("c:\New_folder\1.txt") Then
File.SetAttributes("c:\New_folder\1.txt", FileAttributes.Hidden Or FileAttributes.ReadOnly);
End If;
End Sub Main;
After executing this example, attributes Hidden and Read Only are set for file 1.txt if it exists.
See also: