xref: /third_party/toybox/toys/posix/unlink.c
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/toybox/toys/posix/
10f66f451Sopenharmony_ci/* unlink.c - delete one file
20f66f451Sopenharmony_ci *
30f66f451Sopenharmony_ci * Copyright 2011 Rob Landley <rob@landley.net>
40f66f451Sopenharmony_ci *
50f66f451Sopenharmony_ci * See http://opengroup.org/onlinepubs/9699919799/utilities/unlink.html
60f66f451Sopenharmony_ci
70f66f451Sopenharmony_ciUSE_UNLINK(NEWTOY(unlink, "<1>1", TOYFLAG_USR|TOYFLAG_BIN))
80f66f451Sopenharmony_ci
90f66f451Sopenharmony_ciconfig UNLINK
100f66f451Sopenharmony_ci  bool "unlink"
110f66f451Sopenharmony_ci  default y
120f66f451Sopenharmony_ci  help
130f66f451Sopenharmony_ci    usage: unlink FILE
140f66f451Sopenharmony_ci
150f66f451Sopenharmony_ci    Delete one file.
160f66f451Sopenharmony_ci*/
170f66f451Sopenharmony_ci
180f66f451Sopenharmony_ci#include "toys.h"
190f66f451Sopenharmony_ci
200f66f451Sopenharmony_civoid unlink_main(void)
210f66f451Sopenharmony_ci{
220f66f451Sopenharmony_ci  if (unlink(*toys.optargs))
230f66f451Sopenharmony_ci    perror_exit("couldn't unlink '%s'", *toys.optargs);
240f66f451Sopenharmony_ci}
25

Indexes created Thu Nov 07 10:32:03 CST 2024