<< Previous | Next >>

fat_UnmountPartition

int fat_UnmountPartition( fat_part *part );

Description

Marks the enumerated partition as unmounted on both the FAT and the master boot record levels. The partition must have been already enumerated using fat_EnumPartition() (which happens when you call fat_AutoMount()).

To unmount all FAT partitions on a device call fat_UnmountDevice(), a function introduced with FAT version 2.06. It not only commits all cache entries to the device, but also prepares the device for power down or removal.

NOTE The partitions on a removable device must be unmounted in order to flush data before removal. Failure to unmount a partition that has been written could cause damage to the FAT file system.

Parameters

part
Pointer to a FAT partition structure to unmount.

Return value

0: success.
-EINVAL: device or partition structure or pnum is invalid.
-EBADPART: the partition is not a FAT partition.
-ENOPART: the partition does not exist on the device.
-EPERM: the partition has not been enumerated.
-EBUSY: the device is busy (only if non-blocking ).

Library

FAT.LIB

See Also

fat_EnumPartition, fat_MountPartition, fat_UnmountDevice


Dynamic C Functions << Previous | Next >> rabbit.com