Like Dan pointed out, the code should only be missing this from the saving part:

Code:
FS.WriteBuffer(integer(REC_COUNT), SizeOf(integer));
But if the record count is always same constant its not even necessary to read FileSize if it is always REC_COUNT.