This commit is contained in:
qorg11 2020-06-02 19:48:59 +02:00
parent 87681f91c1
commit 0575e4de01
Signed by: qorg11
GPG Key ID: 343FC20A4ACA62B9
1 changed files with 21 additions and 0 deletions

21
src/ln.c Normal file
View File

@ -0,0 +1,21 @@
#include <stdio.h>
#include <unistd.h>
/* TODO -s flag */
int
main(int argc, char *argv[])
{
if(argc == 1)
{
printf("Usage: ln oldfile newfile\n");
return 1;
}
int fd = link(argv[1],argv[2]);
if(fd == -1)
{
fprintf(stderr,"Error creating link\n");
return 1;
}
return 0;
}