get the number of items in a fcb

I need to get the number of items stored in a fcb and there doesn't seem to be an easy way to get the count from the current read position (fcb_entry struct).

Can anyone advise on a good approach?

Some solutions I've considered:
* Use fcb_getnext in a loop, starting from the read position until fcb_getnext returns an error, however this seems a bit clumsy and possibly slow?
* use fcb_walk, however since deletions are done in sectors, if the read position was part way through a sector, I would count old items that haven't yet been deleted through rotate. Could also be slow?
* modify fcb_walk to take an fcb_entry struct, seems possible, however there are private functions in fcb_walk so I wasn't able to test this fully. Also slow?
* use fcb_offset_last_n with entries = 0 to get the last entry. Then do some arithmetic with the current read position.

Any help would be appreciated.

Parents Reply Children
No Data
Related