Download Print this page

Radio Shack TRS-80 Model II Reference Manual page 175

Disk operating system
Hide thumbs Also See for TRS-80 Model II:

Advertisement

Technical Information
Disk Files
Methods of File Allocation
Model II provides two ways to allocate disk space for files: Dynamic
Allocation and Pre-Allocation.
Dynamic Allocation
With Dynamic Allocation, the System allocates granules only at the time of
write. For example, when a file is first Opened for output, no space is
allocated. The first space allocation is done at the first write. Additional space
is added as required by subsequent writes.
With dynamically allocated files, unused granules are de-allocated
(recovered) when the file is Closed.
Pre-Allocation
With Pre-Allocation, the file is allocated a specified number of granules when
it is Created. Pre-Allocated files can only be created by the operator command
CREATE.
TRSDOS
will dynamically extend (enlarge) a Pre-Allocated file as needed for
subsequent write operation. However,
TRSDOS
will not de-allocate unused
granules when a pre-allocated file is Closed. The way to reduce the size of a
Pre-Allocated file is to Copy it to a dynamically allocated file and Kill the
Pre-Allocated one.
Record Length
The Model II transfers data to and from diskettes one sector at a time; i.e., in
256-byte blocks. These are the System's "physical" records.
User records or "logical" records are the buffers of data you wish to transfer
to or from a file. These can be from 1 to 256 bytes long.
The Operating System will automatically "block" your logical records into
physical records which will be transferred to disk, and "de-block" the physical
records into logical records which are used by your program. Therefore your
only concern during file-access is with logical records. You never need to
worry about physical records, sectors, tracks, etc. This is to your benefit,
since physical record lengths and features may change in later
TRSDOS
versions, while the concept of logical records will not.
From this point on, the term "record" refers to a "logical record".
211

Advertisement

loading