pub fn write_to_file(out: &str, buffer: &mut Box<dyn Write>)
write to a file, but don’t error on broken pipes