Function 22h (34)        Random Write, Using FCBs

Writes the specified record in the current DTA to a file.

On entry:      AH         22h
DX:DS      Pointer to an opened FCB

Returns:       AL         00h       If write was successful
01h       If disk full
02h       If DTA too small (segment wrap)

Network:       Requires Write access rights


This function writes the record specified by the random-record field
(offset 21h) and the record-size field (offset 0Eh) of the FCB. The
current block and current record fields are set to reflect the random-
record field, and the record is written to the file from the current
Disk Transfer Address.

Notes:         The random-record field is not updated after this
function. It is your program's responsibility to set
this field each time it calls this function.
Function 28h, which is similar to this function,
will automatically update the random-record field.
(Function 28h can also write multiple records.)

The data to be written is taken from the current
Disk Transfer Address (DTA). Use Function 1Ah to set
the DTA. If the transfer of data would cause segment
wraparound, an error 2 is generated.

If the record written doesn't fill an entire sector,
DOS buffers the data for an eventual write when a
sector's worth of data is accumulated.

If the file specified has the read-only attribute
set, the write is not performed.

See also: 15h
See also: 1Ah
See also: 28h
See also: 40h
See also: FCB

22h (34) Random Write, Using FCBs