unlink.c 447 B

123456789101112131415161718192021222324
  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. USE_UNLINK(NEWTOY(unlink, "<1>1", TOYFLAG_USR|TOYFLAG_BIN))
  7. config UNLINK
  8. bool "unlink"
  9. default y
  10. help
  11. usage: unlink FILE
  12. Delete one file.
  13. */
  14. #include "toys.h"
  15. void unlink_main(void)
  16. {
  17. if (unlink(*toys.optargs))
  18. perror_exit("couldn't unlink '%s'", *toys.optargs);
  19. }