FF_GetVolumeSize()
From FullFAT
Returns the volume size of the mounted partition in bytes. The return type of this function depends on the FF_64_NUM_SUPPORT setting in the ff_config.h build configuration file.
Contents |
Prototype
#include "ff_config.h" // Include ff_config.h to determine 64-bit support. #ifndef FF_64_NUM_SUPPORT FF_T_UINT32 FF_GetVolumeSize(FF_IOMAN *pIoman); #else FF_T_UINT64 FF_GetVolumeSize(FF_IOMAN *pIoman); #endif
To make your FullFAT code truly portable, you should gate all use of this function as shown in the prototype above.
Back to API.
Example
#include "ff_config.h" #ifndef FF_64_NUM_SUPPORT FF_T_UINT32 VolSize = FF_GetVolumeSize(pIoman); printf("Volume size: %lu\n", VolSize); #else FF_T_UINT64 VolSize = FF_GetVolumeSize(pIoman); printf("Volume size: %llu\n", VolSize); #endif
Back to API.
NOTE
On systems not able to represent integers of 64-bits in length, it is not possible to reliably determine the sizes of volumes > 4GB in size.
Those who can support 64-bit integers are recommended to enable this support by defining FF_64_NUM_SUPPORT in the ff_config.h file.
Back to API.