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 <unistd.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char *argv[]) {
|
main(int argc, char *argv[]) {
|
||||||
while(*argv) {
|
for(int i = 1; i<argc;i++)
|
||||||
rmdir(*argv);
|
{
|
||||||
*argv++;
|
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