commit 0575e4de01c907b372011c5eac705132d3aefffe parent 87681f91c1a20287ebec25befecd5ecd66b69c1c Author: qorg11 <qorg@vxempire.xyz> Date: Tue, 2 Jun 2020 19:48:59 +0200 Add ln Diffstat:
A | src/ln.c | | | 21 | +++++++++++++++++++++ |
1 file changed, 21 insertions(+), 0 deletions(-)
diff --git a/src/ln.c b/src/ln.c @@ -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; +}