truncate: get file size using file stat

This changes ```truncate``` to use ```FileStat```, as was kindly pointed out by @hexsel.