truncates a file to a given size
