FF_GetFreeSize()
From FullFAT
Returns the amount of free disk space on 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_GetFreeSize(FF_IOMAN *pIoman); #else FF_T_UINT64 FF_GetFreeSize(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 FreeSize = FF_GetFreeSize(pIoman); printf("Free Space: %lu\n", FreeSize); #else FF_T_UINT64 FreeSize = FF_GetFreeSize(pIoman); printf("Free Space: %llu\n", FreeSize); #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.

