FAT

FatVolWrSects()

PROTOTYPE

#include <fsdriver.h>

int FatVolWrSects(FAT *fat, void *buf, ui32 first_sect, int count);

DESCRIPTION

FatVolWrSects() writes count sectors to the FAT volume specified by fat, a handle previously returned by FatVolOpen(), beginning at first_sect. buf points to where the data is copied from.

If successful, FatVolWrSects() returns 0. Otherwise, it sets errno and returns -1.

ERROR CODES

EFAULT fat or buf equals NULL.
EINVAL fat is not a valid volume handle.
EROFS The volume is read-only.

EXAMPLE

      FAT *fat;
      ui8 buf[512];

      ...

      /*---------------------------------------------------------------*/
      /* Read one sector from volume's underlying driver.              */
      /*---------------------------------------------------------------*/
      if (FatVolRdSects(fat, buf, 10, 1))
        error("FatVolRdSects() failed");

      /*---------------------------------------------------------------*/
      /* Write sector back to volume's underlying driver.              */
      /*---------------------------------------------------------------*/
      if (FatVolWrSects(fat, buf, 10, 1))
        error("FatVolWrSects() failed");