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. A list of attributes is separated with the OR statement.
Sub UserProc;
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 UserProc;
After executing the example, the Hidden and Read-Only attributes are set for the 1.txt file if it exists.
See also: