Rewritten rmdir
This commit is contained in:
parent
5450b0c602
commit
9077404b75
12
src/rmdir.c
12
src/rmdir.c
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue