I just realized I can shave this down by one expression by removing
"f.truncate f.pos".  I put that in there to esure that, if the
"confused" version were shorter, the file would have the proper length.
However, since the file is always expanded by this algorithm, there's
no need for truncate.