Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5d

Application v 5.25a

  

 

Chapter SixFile Functions (continued)

GetFileAttributeBits Function

Overview

The GetFileAttributeBits function retrieves the attributes of a specified file, file object, or Folder Enumeration Object as a dword value.

Syntax/Parameters

Syntax

dword  = GetFileAttributeBits  ( mixed file );

Parameters

file

A string containing a qualified file name and path. This parameter supports UTF encoding for filenames with Unicode characters. Or,

a handle to either a file (such as one opened with the OpenFile or CreateFile functions) an FTP connection object or a folder enumeration object.

Return Value

Returns a dword representation of the file’s attributes or -1 on failure. Use the GetLastError function to retrieve error information.

Remarks

The file attribute constants are defined as part of the Windows SDK. The most common are listed below:

  Value   Hexadecimal   String   Description
  FILE_ATTRIBUTE_READONLY   0x00000001   'r'   The file is read-only.
  FILE_ATTRIBUTE_HIDDEN   0x00000002   'h'   The file or directory is hidden.
  FILE_ATTRIBUTE_SYSTEM   0x00000004   's'   The file or directory is used by the operating system.
  FILE_ATTRIBUTE_DIRECTORY   0x00000010   'd'   The filename or handle refers to a directory.
  FILE_ATTRIBUTE_ARCHIVE   0x00000020   'a'   The file or directory is an archive.
  FILE_ATTRIBUTE_DEVICE   0x00000040       This value is reserved for use by Windows.
  FILE_ATTRIBUTE_TEMPORARY   0x00000100   't'   The file is being used for temporary storage.
  FILE_ATTRIBUTE_COMPRESSED   0x00000800   'c'   The file or directory is compressed.
  FILE_ATTRIBUTE_ENCRYPTED   0x00004000   'e'   The file or directory is encrypted.

For a complete list of file attribute constants, see the Windows SDK. If the file parameter is not valid, the GetLastError function will return ERROR_INVALID_HANDLE or ERROR_FILE

Relate Functions

Platform Support

Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL

Legato IDE, Legato Basic