SHARE
TWEET

Untitled

a guest Aug 13th, 2018 113 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if (! S_ISREG (st . st_mode)) {
  2.         fprintf (stderr, "%s is not a normal file\n", argv[1]);
  3.         exit(EXIT_FAILURE);
  4. }
  5.  
  6. // this sleep creates a time gap to change the file and create a symbolic link
  7. sleep (10);
  8.  
  9. if ((fp = fopen (argv [1], "w")) == NULL) {
  10.         fprintf (stderr, "Can't open\n");
  11.         exit(EXIT_FAILURE);
  12. }
  13.  
  14. fprintf (fp, "%s\n", argv [2]);
  15. fclose (fp);
  16. fprintf (stderr, "Write Ok\n");
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top