IDirectory.SetAttributes

Syntax

SetAttributes(Path: String; Attributes: FileAttributes);

Parameters

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.

Description

The SetAttributes method sets specified attributes for the directory specified in the Path parameter.

Example

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:

IDirectory