|
|
1.1 ! root 1: /* x_rm.c - x_rm */ ! 2: ! 3: #include <conf.h> ! 4: #include <kernel.h> ! 5: #include <file.h> ! 6: ! 7: /*------------------------------------------------------------------------ ! 8: * x_rm - (command rm) remove a file given its name ! 9: *------------------------------------------------------------------------ ! 10: */ ! 11: COMMAND x_rm(stdin, stdout, stderr, nargs, args) ! 12: int stdin, stdout, stderr, nargs; ! 13: char *args[]; ! 14: { ! 15: if (nargs != 2) { ! 16: fprintf(stderr, "usage: rm file\n"); ! 17: return(SYSERR); ! 18: } ! 19: if ( remove(args[1]) == SYSERR ) { ! 20: fprintf(stderr, "Cannot remove %s\n", args[1]); ! 21: return(SYSERR); ! 22: } ! 23: return(OK); ! 24: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.