Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (! S_ISREG (st . st_mode)) {
- fprintf (stderr, "%s is not a normal file\n", argv[1]);
- exit(EXIT_FAILURE);
- }
- // this sleep creates a time gap to change the file and create a symbolic link
- sleep (10);
- if ((fp = fopen (argv [1], "w")) == NULL) {
- fprintf (stderr, "Can't open\n");
- exit(EXIT_FAILURE);
- }
- fprintf (fp, "%s\n", argv [2]);
- fclose (fp);
- fprintf (stderr, "Write Ok\n");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement