Rewritten rmdir

This commit is contained in:
qorg11 2020-06-01 22:41:59 +02:00
parent 5450b0c602
commit 9077404b75
Signed by: qorg11
GPG Key ID: 343FC20A4ACA62B9
1 changed files with 10 additions and 4 deletions

View File

@ -1,9 +1,15 @@
#include <unistd.h>
#include <stdio.h>
int
main(int argc, char *argv[]) {
while(*argv) {
rmdir(*argv);
*argv++;
}
for(int i = 1; i<argc;i++)
{
int fd = rmdir(argv[i]); /* Is it actually a file descriptor? */
if(fd == -1)
{
fprintf(stderr,"Error removing dir %s\n",argv[i]);
}
}
return 0;
}