Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
let fd = open("/tmp/scratch.txt", O_WRONLY|O_CREAT, 0o666)
if fd < 0 {
perror("could not open /tmp/scratch.txt")
} else {
let text = "Hello World\n"
write(fd, text, strlen(text))
close(fd)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.