SetAttributes(Path: String; Attributes: FileAttributes);
Path - directory, which attributes must be changed.
Attributes - attributes that must be set. It is recommended to use values of the FileAttributes enumerable type to set attributes. Values in the list are separated with the logical OR.
The SetAttributes method sets specified attributes for the directory specified in the Path parameter.
Sub UserProc(sPath: String);
Begin
If Directory.Exists(sPath) Then
Directory.SetAttributes(sPath,
FileAttributes.ReadOnly Or FileAttributes.Hidden);
End If;
End Sub UserProc;
On executing the example it is checked, if the directory specified in the sPath parameter is present in the file system. If the directory exists, the Read-Only and Hidden attributes are set for it.
See also: