Rewrite

From Lazarus wiki
Revision as of 10:42, 9 August 2022 by Kai Burghardt (talk | contribs) (create wanted page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

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) where T is an acceptable record type
  • rewrite(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