Created
July 29, 2014 17:17
-
-
Save erica/864138585c7ea43ed20b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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