Abswrite() : Write on absolute disk sectors in C [dos.h function]

February 12, 2012 No Comments » Hits : 224





Abswrite() : Write absolute disk sectors in C [dos.h function]

Declaration : abswrite()

int abswrite(int drive,int nsects,long lsect,void *buffer);

Remarks:

  1. abswrite uses DOS interrupt 0×26 to read specific disk sectors.
  2. abswrite writes absolute disk sectors
  3. It ignores the logical structure of a disk and pay no attention to files, FATs, or directories.
  4. The number of sectors to read  is limited to 64K or the size of the buffer, whichever is smaller.
  5. If used improperly, abswrite can overwrite files, directories, and FATs.

Parameters

[table style="1"]

ParameterWhat It Is/Does ?
driveDrive number to read (or write): 0 = A, 1 = B, etc.
nsectsNumber of sectors to read (or write)
lsectBeginning logical sector number
bufferMemory address where the data is to be read (or written)

[/table]

Return Value:

  1. On success, return 0.
  2. On error, return -1 and set errno to the value of the AX register returned by the system call.

Incoming search terms: