File types are types that store a sequence of some base type, which can be any type except another le type. It can contain (in principle) an in nite number of elements. File types are used commonly to store data on disk. However, nothing prevents the programmer, from writing a le driver that stores its data for instance in memory.
Here is the type declaration for a le type:
_________________________________________________________________________________________________________File types
___________________________________________________________________
If no type identi er is given, then the le is an untyped le; it can be considered as equivalent to a le of bytes. Untyped les require special commands to act on them (see Blockread, Blockwrite). The following declaration declares a le of records:
Type
Point = Record X,Y,Z : real; end; PointFile = File of Point; |
Internally, les are represented by the FileRec record, which is declared in the Dos or SysUtils units.
A special le type is the Text