moved ftruncate to the right place, doing it right boys