Files.GetAttr

Top  Previous  Next

 

Syntax

function Files.GetAttr(FileName: string): integer

 

Alternative Names

ibec_FileAttr

 

Description

Returns the file attributes for the file identified by FileName. In case of error, NULL is returned, if successful one or a combination of the following is returned:

 

__faReadOnly

Item is a read only file or folder and cannot be modified.

__faHidden

Item is a hidden file or folder and cannot be seen by default.

__faSysFile

Item is a system file or folder.

__faDirectory

The entry is a folder.

__faArchive

File is a Windows archived file.

__faNormal

A normal file.

__faTemporary

Item is a temporary file or folder.

__faSymLink

A symbolic link.

__faCompressed

Item is a compressed file or folder.

__faEncrypted

Item is an encrypted file or folder.

__faAnyFile

Any file type, used in Files.Find.

 

See also

Files.SetAttr
Math.Or

 

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