GoFiler Legato Script Reference
Legato v 1.5b Application v 5.24b
|
Table of Contents | < < Previous | Next >> |
Chapter Six — File Functions (continued)
Overview
The TruncateFilePosition function causes the end of file position within a Basic File Object to be set as 0 or a specified position.
Syntax/Parameters
Syntax
int = TruncateFilePosition ( handle hFileObject, [qword position ] );
Parameters
hFileObject
A handle to a Basic File Object.
position
An optional qword position to which the file will be truncated. If position is larger than the size of the file, the file will be extended.
Return Value
Returns an int as ERROR_NONE or a formatted error code on failure. Use the GetLastError function to retrieve error information.
Remarks
Each file stream has the following:
• | File size: the size of the data in a file (byte level). |
• | Allocation size: the size of the space that is allocated for a file on a disk, which is always an even multiple of the cluster size. |
• | Valid data length: the length of the data in a file that is actually written (byte level). This value is always less than or equal to the file size. |
The TruncateFilePosition function can be used to truncate or extend a file by shifting the valid data length. This is different from either the SetFilePosition or the SetFilePositionAtEnd functions, which adjust the read/write position within a Basic File Object without altering the size of the file. If the file is extended, the contents of the file between the old end of the file and the new end of the file are not defined.
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.