The procedure rewrite clears and opens a file for writing.
If the file did not exist, it is created.
signature
editrewrite(var destination: text)rewrite(var destination: file of T)whereTis an acceptable record typerewrite(var destination: file; recordsize: longInt = 128)(FPC extension)
behavior
editAfter 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.