k9core

Unnamed repository
Log | Files | Refs | LICENSE

commit 60b35102841f8fee5add55482b5a2e4988ab6bca
parent d2be0fee2d5d427d053ee28fe407af64e6575497
Author: qorg11 <qorg@vxempire.xyz>
Date:   Fri,  5 Jun 2020 08:38:52 +0200

Added chmod

Diffstat:
Asrc/chmod.c | 19+++++++++++++++++++
1 file changed, 19 insertions(+), 0 deletions(-)

diff --git a/src/chmod.c b/src/chmod.c @@ -0,0 +1,19 @@ +#include <stdio.h> +#include <stdlib.h> +#include <sys/stat.h> + +int +main(int argc, char *argv[]) +{ + mode_t mode = atoi(argv[1]); + for(int i = 2; i<argc;i++) + { + int fd = chmod(argv[i],mode); + if(fd == -1) + { + printf("Error setting %i on %s\n",mode,argv[i]); + } + } + + return 0; +}