Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.4j

Application v 5.22b

  

 

Chapter SixFile Functions (continued)

GetFileAttributeString Function

Overview

The GetFileAttributeString function retrieves the attributes of a specified file, file object, or Folder Enumeration Object as a string.

Syntax/Parameters

Syntax

string = GetFileAttributeString ( 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 string representation of a file’s attributes or an empty string on failure. Use the GetLastError function to retrieve error information.

Remarks

The file attribute constants are defined as part of the Windows SDK as follows:

  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 the GetFileAttributeString function, letters matching the bitwise flags are always placed in the same position within the returned string. Dashes appear where the bit is not set. For example, the following indicates a hidden directory:

-h-d----

If the file attribute bit does not match a letter description, no information concerning that bit will be returned. 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

Related Functions

Platform Support

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

Legato IDE, Legato Basic