| 680 | } |
| 681 | |
| 682 | void write_file_buf(const char *path, const char *buf, size_t len) |
| 683 | { |
| 684 | int fd = xopen(path, O_WRONLY | O_CREAT | O_TRUNC, 0666); |
| 685 | if (write_in_full(fd, buf, len) < 0) |
| 686 | die_errno(_("could not write to '%s'"), path); |
| 687 | if (close(fd)) |
| 688 | die_errno(_("could not close '%s'"), path); |
| 689 | } |
| 690 | |
| 691 | void write_file(const char *path, const char *fmt, ...) |
| 692 | { |