df160d90ae
Using `write` means that it's possible that not all data gets written out. Rather than check the return value and write in a loop, just use `write_all`.