implement truncate and ftruncate