implement truncate and ftruncate
Merge pull request #70 from ispedals/truncate

Good code, good tests. Merging.