Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <unistd.h>
- #include <stdlib.h>
- #include <stdio.h>
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <fcntl.h>
- int main(void){
- char *fname = "a.txt";
- int f = creat(fname,0755);
- if( f == -1 ){
- fprintf(stderr,"Can't creat '%s'",fname);
- exit(1);
- }
- printf("'%s' created: %d\n", fname, f);
- close(f);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement