Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- #include <unistd.h>
- int main(int argc, char **argv)
- {
- int x;
- printf("Optiunea:\n");
- printf("1.Hardlink\n");
- printf("2.Symlink\n");
- scanf("%d", &x);
- if(x==2)
- {
- int sc = symlink(argv[1], argv[2]);
- if(!sc){
- printf("ERROR: %s", strerror(sc));
- return -1;
- }
- }
- else
- if(x==1){
- int sc = symlink(argv[1], argv[2]);
- link(argv[1], argv[2]);
- if(!sc){
- printf("ERROR: %s", strerror(sc));
- return -1;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement