◄Summary► ◄Details► ◄Example► ◄Back► Argument file_variable Open typed or untyped file Description The Truncate procedure resizes a file. It truncates the file from the component at the current position to the end-of-file marker. The current file position becomes the new end-of-file. The end-of-file status as returned by the Eof function is True. Information in the deleted portion of the file is lost. Truncate applies to open typed or untyped files. Truncate cannot be called for a text file variable, but can be used on a text file when file_variable is declared as FILE OF Char. If file_variable is not associated with a file, or if the file is not open when Truncate is called, an I/O error occurs. To prevent a program from halting with a run-time error when an I/O error occurs, turn off I/O checking with {$I-} and check the return value of the IOResult function.