GoFiler Legato Script Reference
Legato v 1.5b Application v 5.24b
|
Table of Contents | < < Previous | Next >> |
Chapter Six — File 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
Table of Contents | < < Previous | Next >> |
© 2012-2024 Novaworks, LLC. All rights reserved worldwide. Unauthorized use, duplication or transmission prohibited by law. Portions of the software are protected by US Patents 10,095,672, 10,706,221 and 11,210,456. GoFiler™ and Legato™ are trademarks of Novaworks, LLC. EDGAR® is a federally registered trademark of the U.S. Securities and Exchange Commission. Novaworks is not affiliated with or approved by the U.S. Securities and Exchange Commission. All other trademarks are property of their respective owners. Use of the features specified in this language are subject to terms, conditions and limitations of the Software License Agreement.