IFile.SetAttributes

Syntax

SetAttributes(FileName: String; Attributes: FileAttributes);

Parameters

FileName - a path and name of the file, attribute of which should be changed.

Attributes - file attributes that should be set.

Description

The GetAttributes method changes attributes of a file passed by the parameter FileName. List of attributes is separated with operator Or.

Example

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:

IFile