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. Nothing prevents the programmer, however, from writing a le driver that stores it's data 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 unit.
A special le type is the Text