Basic Disk Operating System (BDOS) Functions
Table 4-5
Function
34 (Write
Random)
Error
Codes
CODE
01
02
03
04
05
06
MEANING
(not
returned by the
Random
Write command)
No
a vaiia ble
data
block -
The
Write
Random
command
attempts
to allocate a new
data
block
to
the file
and
no
unallocated
data
blocks exist
on
the selected disk drive.
Cannot
close current extent -
The
BOOS
cannot
close
the current extent prior
to
moving to the new extent
containing the record specified by bytes
rO,
r 1
of
the FCB.
This
error
can
be caused by
an
overwritten FCB
or
a write
random
operation
on
an
FCB
that
has
not
been opened.
(not
returned by the
Random
Write command)
No
available directory space - The write
command
attempts
to create a new extent
that
requires a new
directory entry
and
no available directory entries exist
on
the selected disk drive.
Random
record
number
out
of
range - Byte r2
of
the
FCB
is
non-zero.
The
virtual size
of
a file corresponds
to
the physical size only when the file is written
sequentially.
If
a file is created in
random
mode
and
"holes" exist in the allocation,
then
the file
may
in fact
contain
fewer records
than
the size indicates.
For
example,
if
a single record with record
number
65535
(CP/M's
maximum record number)
is
written
to
a file using the Write
Random
function, then the virtual size
of
the file
is
65536 records, although only one block
of
data
is actually allocated.
To
append
data
to
the
end
of
an
existing file, call function
35
to
set the
random
record position
to
the end
of
file. Then,
perform
a sequence
of
random
writes
starting
at
the preset record address.
4-27