<< Previous | Next >> | |
|
int fat_FormatPartition( mbr_dev *dev, fat_part *part, int pnum, int type, char *label, int (*usr)() );
Description
- Formats partition number
pnum
according to partition type. The partition table information in the device must be valid. This will always be the case if the device was enumerated. The partition type must be a valid FAT type. Also note that the partition is not mounted after the partition is formatted. If-EBUSY
is returned, the partition structure must not be disturbed until a subsequent call returns something other than-EBUSY
.
- If needed (i.e.,
fat_MountPartition()
returned error code-EBADPART
), this function is called byfat_AutoMount()
.Parameters
- dev
- Pointer to a device structure containing partitions.
- part
- Pointer to a FAT partition structure to be linked. Note that
opstate
must be set to zero before first call to this function if the library is being used in the non-
- blocking mode.
- pnum
- Partition number on the device (0-3).
- type
- Partition type.
- label
- Pointer to a partition label string.
- usr
- Pointer to a user routine.
Return Value
0
: success.
-EIO
: error in reading the device or structure.
-EINVAL
: the partition number is invalid.
-EPERM
: write access is not allowed.
-EUNFORMAT
: the device is accessible, but is not formatted.
-EBADPART
: the partition is not a valid FAT partition.
-EACCES
: the partition is currently mounted.
-EBUSY
: the device is busy (Only if non-blocking.).Library
- FAT.LIB
See Also
- fat_AutoMount, fat_Init, fat_FormatDevice, fat_EnumDevice, fat_PartitionDevice, fat_EnumPartition
Dynamic C Functions | << Previous | Next >> | rabbit.com |