Last active
August 29, 2015 14:06
-
-
Save tsu-nera/f0be86e0a704471372b3 to your computer and use it in GitHub Desktop.
File open with C language
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> | |
int main (void) | |
{ | |
FILE *fp; | |
fp = fopen ("/home/tsu-nera/tmp/test", "w"); | |
fclose (fp); | |
return 0; | |
} |
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 <sys/types.h> | |
#include <sys/stat.h> | |
#include <fcntl.h> | |
#include <unistd.h> | |
int main (void) | |
{ | |
int fd; | |
fd = open ("/home/tsu-nera/tmp/test", O_RDWR|O_CREAT, S_IREAD | S_IWRITE); | |
close (fd); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment