Abswrite() : Write absolute disk sectors in C [dos.h function]
Declaration : abswrite()
int abswrite(int drive,int nsects,long lsect,void *buffer);
Remarks:
- abswrite uses DOS interrupt 0×26 to read specific disk sectors.
- abswrite writes absolute disk sectors
- It ignores the logical structure of a disk and pay no attention to files, FATs, or directories.
- The number of sectors to read is limited to 64K or the size of the buffer, whichever is smaller.
- If used improperly, abswrite can overwrite files, directories, and FATs.
Parameters
[table style="1"]
Parameter | What It Is/Does ? |
---|---|
drive | Drive number to read (or write): 0 = A, 1 = B, etc. |
nsects | Number of sectors to read (or write) |
lsect | Beginning logical sector number |
buffer | Memory address where the data is to be read (or written) |
[/table]
Return Value:
- On success, return 0.
- On error, return -1 and set errno to the value of the AX register returned by the system call.