Home > Language Reference > File Functions > SetAttr

SetAttr

The SetAttr function modifies the attributes of the specified file(s).

Usage

Used to set the attributes of a file.

Syntax

ret=SetAttr(<filename>,<attribute>)

Parameters

<filename>, string, name of the file. Wildcards (* or ? characters) are allowed in <filename>.

<attribute>, integer, sum of values specifying the attributes. The possible values are:

Parameter   Attribute description
 0  No attribute
 1  Read only
 2  Hidden
 4  System
 32  Archive

Return value

ret,  optional numeric return value. If the function has successfully modified the attributes, the return value is 0. If the function fails, the return value is a nonzero value (see File Functions Error Codes).

See also

FileAttr$

Example

SetAttr("c:\wttest\example.*", 0) ' Deletes all the attributes of the files "c:\wttest\example.* "