SetAttributes(FileName: String; Attributes: FileAttributes);
FileName - path and name of the file, which attribute must be changed.
Attributes - file attributes that must be set.
The GetAttributes method changes attributes of a file passed by the FileName parameter. The list of attributes is separated with the OR operator.
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 the example, the Hidden and Read-Only attributes are set for the 1.txt file if it exists.
See also: