1
0
Fork 0
mirror of https://gitlab.com/sortix/sortix.git synced 2023-02-13 20:55:38 -05:00
sortix--sortix/utils/rm.cpp
Jonas 'Sortie' Termansen 8b2b52b9f6 Added unlink(2) and rm(1).
2011-11-21 19:01:56 +01:00

20 lines
325 B
C++

#include <stdio.h>
#include <unistd.h>
int main(int argc, char* argv[])
{
if ( argc < 2 ) { printf("usage: %s <file> ...\n"); return 0; }
int result = 0;
for ( int i = 1; i < argc; i++ )
{
if ( unlink(argv[i]) )
{
printf("%s: unable to unlink: %s\n", argv[0], argv[i]);
result = 1;
}
}
return result;
}