As ftruncate is not availabe on all platforms, switch back to