Advertisement
regzarr

Untitled

Nov 18th, 2019
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <unistd.h>
  4. int main(int argc, char **argv)
  5. {
  6. int x;
  7. printf("Optiunea:\n");
  8. printf("1.Hardlink\n");
  9. printf("2.Symlink\n");
  10. scanf("%d", &x);
  11. if(x==2)
  12. {
  13. int sc = symlink(argv[1], argv[2]);
  14. if(!sc){
  15. printf("ERROR: %s", strerror(sc));
  16. return -1;
  17. }
  18. }
  19. else
  20. if(x==1){
  21. int sc = symlink(argv[1], argv[2]);
  22. link(argv[1], argv[2]);
  23. if(!sc){
  24. printf("ERROR: %s", strerror(sc));
  25. return -1;
  26. }
  27. }
  28. return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement