abswrite
Writes absolute disk sectors.
Defined in header <dos.h>
Syntax
#include <dos.h>
int abswrite(int drive, int nsects, long Isect, void *buffer);
Portability
| DOS | UNIX | Windows | ANSI C | C++ only |
|---|---|---|---|---|
| ■ |
Remarks
abswrite writes specific disk sectors. It ignores the logical structure of a disk and pays no attention to files, FATs, or directories.
bl^
If used improperly, abswrite can overwrite files, directories, and FATs.
abswrite uses DOS interrupt 0x26 to write specific disk sectors.
drive = drive number to write to (0 = A, 1 = B, etc.) nsects = number of sectors to write to Isect = beginning logical sector number bujfer = memory address where the data is to be written
The number of sectors to write to is limited to 64K or the size of the buffer, whichever is smaller.
Return value
If it is successful, abswrite returns 0.
On error, the routine returns -1 and sets the global variable errno to the value of the AX register returned by the system call.
See also
Differences from modern implementations
Nothing recorded yet.
Modern references
These are search links, not yet checked by hand.
Extraction notes
- heading `a bs write` read as `abswrite`
Stable link: /3.1/dos.h/abswrite/
· short form /3.1/abswrite/