Click here to return to the KiXtart HelpDesk main page...

KiXtart 2001 Manual

GetFileAttr( )

Action: Returns the attributes of a file.
 
Syntax: GETFILEATTR ("file name")
 
Parameters: File name

Identifies the file for which you want to retrieve the attributes.

Returns:

Zero to indicate the function failed. If the function failed, check @ERROR for details on the error. Otherwise, the return value represents the attributes of the file. The attributes can be one or more of the following values:

1

Read only

The file or directory is read-only. Applications can read the file but cannot write to it or delete it. In the case of a directory, applications cannot delete it.

2

Hidden

The file or directory is hidden. It is not included in an ordinary directory listing.

4

System

The file or directory is part of, or is used exclusively by, the operating system.

16

Directory

The filename identifies a directory.

32

Archive

The file or directory is an archive file or directory. Applications use this attribute to mark files for backup or removal.

64

Encrypted

The file or directory is encrypted. For a file, this means that all data streams are encrypted. For a directory, this means that encryption is the default for newly created files and subdirectories.

128

Normal

The file or directory has no other attributes set. This attribute is valid only if used alone.

256

Temporary

The file is being used for temporary storage. File systems attempt to keep all of the data in memory for quicker access rather than flushing the data back to mass storage. A temporary file should be deleted by the application as soon as it is no longer needed.

512

Sparse file

The file is a sparse file.

1024

Reparse point

The file has an associated reparse point.

2048

Compressed

The file or directory is compressed. For a file, this means that all of the data in the file is compressed. For a directory, this means that compression is the default for newly created files and subdirectories.

4096

Offline

The data of the file is not immediately available. Indicates that the file data has been physically moved to offline storage.
 

See Also: GetFileSize( ), GetFileTime( ), GetFileVersion( ), SetFileAttr( )
 
Example:

$Result = GetFileAttr(@LDRIVE + "\Kix32.exe")
IF GetFileAttr( "C:\TEMP" ) & 16
  ; Bitwise AND on 4th bit
  ? "C:\temp is a directory !"