Rewrite
The procedure rewrite clears and opens a file for writing. If the file did not exist, it is created.
signature
rewrite(var destination: text)rewrite(var destination: file of T)whereTis an acceptable record typerewrite(var destination: file; recordsize: longInt = 128)(FPC extension)
behavior
After invoking rewrite it is guaranteed that
- the destination file is completely undefined (i. e. empty),
- the writing cursor is at the beginning of the file, and
- the file is writable and non-readable.
see also
From the Free Pascal wiki, page "Rewrite", as it stood on 2022-08-09 after a change by Kai Burghardt, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.