Mercurial > hg > toybox
annotate toys/link.c @ 503:3b9dea897dc0
Upgrade yesno() and make cp -i use it.
author | Rob Landley <rob@landley.net> |
---|---|
date | Mon, 27 Feb 2012 21:56:49 -0600 |
parents | ab6c0adfcc10 |
children |
rev | line source |
---|---|
388 | 1 /* vi: set sw=4 ts=4: |
2 * | |
3 * link.c - hardlink a file | |
4 * | |
5 * Copyright 2011 Rob Landley <rob@landley.net> | |
6 * | |
7 * See http://opengroup.org/onlinepubs/9699919799/utilities/link.html | |
8 | |
9 USE_LINK(NEWTOY(link, "<2>2", TOYFLAG_USR|TOYFLAG_BIN)) | |
10 | |
11 config LINK | |
12 bool "link" | |
13 default y | |
14 help | |
15 usage: link FILE NEWLINK | |
16 | |
17 Create hardlink to a file. | |
18 */ | |
19 | |
20 #include "toys.h" | |
21 | |
22 void link_main(void) | |
23 { | |
24 if (link(toys.optargs[0], toys.optargs[1])) | |
465
ab6c0adfcc10
Error message fix from Pere (gotrunks at gmail).
Rob Landley <rob@landley.net>
parents:
388
diff
changeset
|
25 perror_exit("couldn't link '%s' to '%s'", toys.optargs[1], |
ab6c0adfcc10
Error message fix from Pere (gotrunks at gmail).
Rob Landley <rob@landley.net>
parents:
388
diff
changeset
|
26 toys.optargs[0]); |
388 | 27 } |