As with `fopen` we should silence errors in `fwrite`, also what happens if writing fails here?