banan-os/userspace/rm/main.cpp

23 lines
285 B
C++
Raw Normal View History

2023-10-25 21:45:27 +03:00
#include <stdio.h>
#include <unistd.h>
int main(int argc, char** argv)
{
if (argc <= 1)
{
fprintf(stderr, "Missing operand\n");
return 1;
}
int ret = 0;
for (int i = 1; i < argc; i++)
{
if (unlink(argv[i]) == -1)
{
perror(argv[i]);
ret = 1;
}
}
return ret;
}