• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* unlink.c - delete one file
2  *
3  * Copyright 2011 Rob Landley <rob@landley.net>
4  *
5  * See http://opengroup.org/onlinepubs/9699919799/utilities/unlink.html
6 
7 USE_UNLINK(NEWTOY(unlink, "<1>1", TOYFLAG_USR|TOYFLAG_BIN))
8 
9 config UNLINK
10   bool "unlink"
11   default y
12   help
13     usage: unlink FILE
14 
15     Delete one file.
16 */
17 
18 #include "toys.h"
19 
unlink_main(void)20 void unlink_main(void)
21 {
22   if (unlink(*toys.optargs))
23     perror_exit("couldn't unlink '%s'", *toys.optargs);
24 }
25