| 23 | } |
| 24 | |
| 25 | void create_file(const char *path, const char *buffer) { |
| 26 | int fd = open(path, O_WRONLY | O_CREAT | O_EXCL, 0666); |
| 27 | assert(fd >= 0); |
| 28 | |
| 29 | int err = write(fd, buffer, sizeof(char) * strlen(buffer)); |
| 30 | assert(err == (sizeof(char) * strlen(buffer))); |
| 31 | |
| 32 | close(fd); |
| 33 | } |
| 34 | |
| 35 | int main() { |
| 36 | // Get the default umask |