CTL_STATUS_t ctl_ms_unused_clusters(const char *volume,
                                    CTL_MS_CLUSTER_t *unused);

ctl_ms_unused_clusters computes the number of unused clusters on the volume named volume.

On volumes with large FAT tables, ctl_ms_unused_clusters may take a long time as the whole of the FAT is traversed to calculate the unused clusters.

Thread Safety

ctl_ms_unused_clusters is thread-safe. Note that although this function is thread-safe, it will lock out all file operations on the volume vol while computing the number of free clusters.