Created
August 19, 2020 15:39
-
-
Save joshwilliams/51adb08ca1a31cf63bb6748048bd4858 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
#include <stdio.h> | |
#include <errno.h> | |
#include <fcntl.h> | |
#include <string.h> | |
int errnum, fd; | |
int main(int argc, char *argv[]) { | |
if ( argc == 2 ) { | |
fd = open(argv[1], O_CREAT); | |
if (fd == -1) { | |
fprintf(stderr, "Error opening %s: %s (%d)\n", argv[1], strerror(errno), errno); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment