GoFiler Legato Script Reference
Legato v 1.5b Application v 5.24b
|
Table of Contents | < < Previous | Next >> |
Chapter Six — File Functions (continued)
Overview
The CreateFile function creates a random-access Basic File Object that can be accessed for reading, writing, and random positioning.
Syntax/Parameters
Syntax
handle = CreateFile ( string name, [dword mode] );
Parameters
name
A string containing a fully qualified path and filename. This parameter supports UTF encoding for filenames with Unicode characters. If the name is empty, a temporary file is created. See Remarks below.
mode
An optional dword specifying rights to the file. The parameter can be a combination of bitwise flags. See the Section 6.2 File Access Modes function to see a description of the bits. If omitted, the file is created with read/write access exclusive.
Return Value
Returns a handle to the Basic File Object or 0 on failure. Use the GetLastError function to retrieve error information. The GetLastErrorMessage function may contain information to supplement the error code. Error codes match Windows system error codes (for a list, see the Appendix or MSDN).
Remarks
The CreateFile function is a low-level function that allows for direct access to files located on a variety of devices. The files can be located on an NTFS or FAT file system. Access rights to the file are dependent on the user permissions set within the operating system. Files cannot be located on HTTP or FTP routines unless there is access via the Virtual File Cloud (VFC).
The function returns a handle to the file that can be used for various types of I/O. The handle should be closed using the CloseFile or DeleteFile functions.
If the name parameter is an empty string, a temporary file is created in the user’s temp folder (usually located at “%temp%”). Use the GetName function to retrieve the name of the file if needed. The temp file will automatically be deleted when the supporting application is shut down (not when script file ends).
The CreateFile function always overwrites and truncates existing files.
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.