Function 28h (40)        Random Block Write, Using FCBs

Writes one or more records from the current Disk Transfer Address to a

On entry:      AH         28h
CX         Number of records to write
DS:DX      Pointer to an opened FCB

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

Network:       Requires Write access rights


This function writes the number of records specified by CX, starting
at the file offset specified by random-record (offset 21h) and record-
size (0Eh) fields of the FCB. The current block and current record
fields are set to reflect the random-record field, and the records are
written to the file from the current DTA.

Notes:         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 records being written don't fill an entire
sector, DOS buffers the data for an eventual write
when a full sector's worth of data is accumulated.

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

If you specify a value of 0 in CX, the function
writes no records, but it adjusts the file's length
to the position of the specified random record. This
is useful if you have logically deleted records at
the end of the file, since it enables you to
truncate the file appropriately and free up disk

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

28h (40) Random Block Write, Using FCBs