Files.SetAttr |
Top Previous Next |
Syntax function Files.SetAttr(FileName: string; Attr: integer): integer
Alternative Names
Description Sets the file attributes for the file identified by FileName. File attributes Attr can be one or a combination of the following:
The routine returns zero if successful and an error code otherwise, you can use that error code with Shell.GetErrorMessage for an error description.
See also
Example execute udsblock as begin /* get current file attributes */ attrs = Files.GetAttr('c:\data\myfile.txt');
/* include 'read only' flag for the file attributes by using a bitwise OR from the Math namespace */ newattrs = Math.Or(attrs, __faReadOnly);
/* modify file attributes */ Files.SetAttr('c:\data\myfile.txt', newattrs); end |