xref: /dragonfly/usr.bin/pathchk/pathchk.1 (revision 9ddb8543)
1.\" Copyright (c) 2001, 2002 Chuck Rouillard
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\" 3. The name of the author may not be used to endorse or promote
13.\"    products derived from this software without specific prior written
14.\"    permission.
15.\"
16.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
17.\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
20.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26.\" SUCH DAMAGE.
27.\"
28.\" $FreeBSD: src/usr.bin/pathchk/pathchk.1,v 1.2.2.4 2003/02/24 22:37:42 trhodes Exp $
29.\" $DragonFly: src/usr.bin/pathchk/pathchk.1,v 1.2 2003/06/17 04:29:30 dillon Exp $
30.\"
31.Dd May 21, 2002
32.Dt PATHCHK 1
33.Os
34.Sh NAME
35.Nm pathchk
36.Nd check pathnames
37.Sh SYNOPSIS
38.Nm
39.Op Fl p
40.Ar pathname ...
41.Sh DESCRIPTION
42The
43.Nm
44utility checks whether each of the specified
45.Ar pathname
46arguments is valid or portable.
47.Pp
48A diagnostic message is written for each argument that:
49.Bl -bullet
50.It
51Is longer than
52.Dv PATH_MAX
53bytes.
54.It
55Contains any component longer than
56.Dv NAME_MAX
57bytes.
58(The value of
59.Dv NAME_MAX
60depends on the underlying file system.)
61.It
62Contains a directory component that is not searchable.
63.El
64.Pp
65It is not considered an error if a
66.Ar pathname
67argument contains a nonexistent component as long as a component by that
68name could be created.
69.Pp
70The options are as follows:
71.Bl -tag -width indent
72.It Fl p
73Perform portability checks on the specified
74.Ar pathname
75arguments.
76Diagnostic messages will be written for each argument that:
77.Bl -bullet
78.It
79Is longer than
80.Dv _POSIX_PATH_MAX
81.Pq 255
82bytes.
83.It
84Contains a component longer than
85.Dv _POSIX_NAME_MAX
86.Pq 14
87bytes.
88.It
89Contains any character not in the portable filename character set (that is,
90alphanumeric characters,
91.Ql \&. ,
92.Ql \&-
93and
94.Ql _ ) .
95No component may start with the hyphen
96.Pq Ql \&-
97character.
98.El
99.El
100.Sh EXIT STATUS
101.Ex -std
102.Sh EXAMPLES
103Check whether the names of files in the current directory are portable to
104other
105.Tn POSIX
106systems:
107.Pp
108.Dl "find . -print | xargs pathchk -p"
109.Sh SEE ALSO
110.Xr getconf 1 ,
111.Xr pathconf 2 ,
112.Xr stat 2
113.Sh STANDARDS
114The
115.Nm
116utility conforms to
117.St -p1003.1-2001 .
118.Sh HISTORY
119A
120.Nm
121utility appeared in
122.Fx 5.0 .
123