Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fcntl.h>
- #include <unistd.h>
- #include <stdlib.h>
- void data_create(char *filename);
- void pos_create(char *filename);
- int main(int argc, char*argv[])
- {
- }
- void data_create(char *filename)
- {
- int fd1;
- if ((fd1 = open(filename, O_CREAT| O_RDWR | O_TRUNC | O_APPEND, S_IRWXU)) == -1) {
- write(2,"file error...\n",20);
- _exit(1);
- }
- close(fd1);
- }
- void pos_create(char *filename)
- {
- int fd2;
- if ((fd2 = open(filename, O_CREAT| O_RDWR | O_TRUNC | O_APPEND, S_IRWXU)) == -1) {
- write(2,"file error...\n",20);
- _exit(1);
- }
- close(fd2);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement