ladybird/Userland/rmdir.cpp
Andreas Kling c95228b128 Add support for removing directories.
It's really only supported in Ext2FS since SynthFS doesn't really want you
mucking around with its files. This is pretty neat though :^)

I ran into some trouble with HashMap while working on this but opted to work
around it and leave that for a separate investigation.
2019-01-28 04:16:01 +01:00

19 lines
301 B
C++

#include <stdio.h>
#include <errno.h>
#include <unistd.h>
int main(int argc, char** argv)
{
if (argc != 2) {
fprintf(stderr, "usage: rmdir <path>\n");
return 1;
}
int rc = rmdir(argv[1]);
if (rc < 0) {
perror("rmdir");
return 1;
}
return 0;
}