comparison toys/other/realpath.c @ 653:2986aa63a021

Move commands into "posix", "lsb", and "other" menus/directories.
author Rob Landley <rob@landley.net>
date Sat, 25 Aug 2012 14:25:22 -0500
parents toys/realpath.c@7d4dbde67dfb
children 6df4ccc0acbe
comparison
equal deleted inserted replaced
652:2d7c56913fda 653:2986aa63a021
1 /* vi: set sw=4 ts=4:
2 *
3 * realpath.c - Return the canonical version of a pathname
4 *
5 * Copyright 2012 Andre Renaud <andre@bluewatersys.com>
6 *
7 * Not in SUSv4.
8
9 USE_REALPATH(NEWTOY(realpath, "<1", TOYFLAG_USR|TOYFLAG_BIN))
10
11 config REALPATH
12 bool "realpath"
13 default y
14 help
15 usage: realpath FILE...
16
17 Display the canonical absolute pathname
18 */
19
20 #include "toys.h"
21
22 void realpath_main(void)
23 {
24 char **s = toys.optargs;
25 for (s = toys.optargs; *s; s++) {
26 if (!realpath(*s, toybuf)) {
27 perror_msg("cannot access '%s'", *s);
28 toys.exitval = 1;
29 } else xputs(toybuf);
30 }
31 }