1 /* rmdir.c - remove directory/path
3 * Copyright 2008 Rob Landley <rob@landley.net>
5 * See http://opengroup.org/onlinepubs/9699919799/utilities/rmdir.html
7 USE_RMDIR(NEWTOY(rmdir, "<1p", TOYFLAG_BIN))
13 usage: rmdir [-p] [dirname...]
15 Remove one or more directories.
22 static void do_rmdir(char *name)
32 // Each -p cycle back up one slash, ignoring trailing and repeated /.
34 if (!toys.optflags) return;
36 if (!(temp = strrchr(name, '/'))) return;
46 for (s=toys.optargs; *s; s++) do_rmdir(*s);