Files
fx/test/io/rmdir.c

26 lines
419 B
C
Raw Permalink Normal View History

2026-03-16 10:35:43 +00:00
#include <fx/io/directory.h>
2025-08-09 19:41:57 +01:00
int main(int argc, const char **argv)
{
if (argc < 2) {
return -1;
}
const char *path = argv[1];
2026-03-16 10:35:43 +00:00
fx_directory *dir;
fx_result result = fx_directory_open(NULL, FX_RV_PATH(path), 0, &dir);
if (fx_result_is_error(result)) {
fx_throw(result);
2025-08-09 19:41:57 +01:00
return -1;
}
2026-03-16 10:35:43 +00:00
result = fx_directory_delete(dir);
if (fx_result_is_error(result)) {
fx_throw(result);
2025-08-09 19:41:57 +01:00
return -1;
}
return 0;
}