xref: /netbsd-src/usr.bin/pathchk/pathchk.1 (revision 78f9e33271789b7b54a3c79339d544050291d42b)
1*78f9e332Swiz.\"	$NetBSD: pathchk.1,v 1.6 2010/11/16 23:59:02 wiz Exp $
2938f344dSjdolecek.\"
3938f344dSjdolecek.\" Copyright (c) 2001, 2002 Chuck Rouillard
4938f344dSjdolecek.\" All rights reserved.
5938f344dSjdolecek.\"
6938f344dSjdolecek.\" Redistribution and use in source and binary forms, with or without
7938f344dSjdolecek.\" modification, are permitted provided that the following conditions
8938f344dSjdolecek.\" are met:
9938f344dSjdolecek.\" 1. Redistributions of source code must retain the above copyright
10938f344dSjdolecek.\"    notice, this list of conditions and the following disclaimer.
11938f344dSjdolecek.\" 2. Redistributions in binary form must reproduce the above copyright
12938f344dSjdolecek.\"    notice, this list of conditions and the following disclaimer in the
13938f344dSjdolecek.\"    documentation and/or other materials provided with the distribution.
14938f344dSjdolecek.\" 3. The name of the author may not be used to endorse or promote
15938f344dSjdolecek.\"    products derived from this software without specific prior written
16938f344dSjdolecek.\"    permission.
17938f344dSjdolecek.\"
18938f344dSjdolecek.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
19938f344dSjdolecek.\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20938f344dSjdolecek.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21938f344dSjdolecek.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
22938f344dSjdolecek.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23938f344dSjdolecek.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24938f344dSjdolecek.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25938f344dSjdolecek.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26938f344dSjdolecek.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27938f344dSjdolecek.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28938f344dSjdolecek.\" SUCH DAMAGE.
29938f344dSjdolecek.\"
30938f344dSjdolecek.\" from FreeBSD: pathchk.1,v 1.3 2002/12/12 17:26:01 ru Exp
31938f344dSjdolecek.\"
32*78f9e332Swiz.Dd November 9, 2010
33938f344dSjdolecek.Dt PATHCHK 1
34938f344dSjdolecek.Os
35938f344dSjdolecek.Sh NAME
36938f344dSjdolecek.Nm pathchk
37938f344dSjdolecek.Nd check pathnames
38938f344dSjdolecek.Sh SYNOPSIS
39938f344dSjdolecek.Nm
40938f344dSjdolecek.Op Fl p
41938f344dSjdolecek.Ar pathname ...
42938f344dSjdolecek.Sh DESCRIPTION
43938f344dSjdolecekThe
44938f344dSjdolecek.Nm
45938f344dSjdolecekutility checks whether each of the specified
46938f344dSjdolecek.Ar pathname
47938f344dSjdolecekarguments is valid or portable.
48938f344dSjdolecek.Pp
49938f344dSjdolecekA diagnostic message is written for each argument that:
50938f344dSjdolecek.Bl -bullet
51938f344dSjdolecek.It
52938f344dSjdolecekIs longer than
53938f344dSjdolecek.Dv PATH_MAX
54938f344dSjdolecekbytes.
55938f344dSjdolecek.It
56938f344dSjdolecekContains any component longer than
57938f344dSjdolecek.Dv NAME_MAX
58938f344dSjdolecekbytes.
59938f344dSjdolecek(The value of
60938f344dSjdolecek.Dv NAME_MAX
61938f344dSjdolecekdepends on the underlying file system.)
62938f344dSjdolecek.It
63938f344dSjdolecekContains a directory component that is not searchable.
64938f344dSjdolecek.El
65938f344dSjdolecek.Pp
66938f344dSjdolecekIt is not considered an error if a
67938f344dSjdolecek.Ar pathname
68938f344dSjdolecekargument contains a nonexistent component as long as a component by that
69938f344dSjdolecekname could be created.
70938f344dSjdolecek.Pp
71938f344dSjdolecekThe options are as follows:
72938f344dSjdolecek.Bl -tag -width indent
73938f344dSjdolecek.It Fl p
74938f344dSjdolecekPerform portability checks on the specified
75938f344dSjdolecek.Ar pathname
76938f344dSjdolecekarguments.
77938f344dSjdolecekDiagnostic messages will be written for each argument that:
78938f344dSjdolecek.Bl -bullet
79938f344dSjdolecek.It
80938f344dSjdolecekIs longer than
81938f344dSjdolecek.Dv _POSIX_PATH_MAX
82938f344dSjdolecek.Pq 255
83938f344dSjdolecekbytes.
84938f344dSjdolecek.It
85938f344dSjdolecekContains a component longer than
86938f344dSjdolecek.Dv _POSIX_NAME_MAX
87938f344dSjdolecek.Pq 14
88938f344dSjdolecekbytes.
89938f344dSjdolecek.It
90938f344dSjdolecekContains any character not in the portable filename character set (that is,
91938f344dSjdolecekalphanumeric characters,
92938f344dSjdolecek.Ql \&. ,
93938f344dSjdolecek.Ql \&-
94938f344dSjdolecekand
95938f344dSjdolecek.Ql _ ) .
96938f344dSjdolecekNo component may start with the hyphen
97938f344dSjdolecek.Pq Ql \&-
98938f344dSjdolecekcharacter.
99938f344dSjdolecek.El
100938f344dSjdolecek.El
101938f344dSjdolecek.Sh EXAMPLES
102938f344dSjdolecekCheck whether the names of files in the current directory are portable to
103938f344dSjdolecekother
104938f344dSjdolecek.Tn POSIX
105938f344dSjdoleceksystems:
106938f344dSjdolecek.Pp
1074c73f7f0Sapb.Dl "find . -exec pathchk -p \e{\e} +"
108d6f06df4Schristosor the more efficient:
109d6f06df4Schristos.Dl "find . -print0 | xargs -0 pathchk -p"
110938f344dSjdolecek.Sh SEE ALSO
111938f344dSjdolecek.Xr getconf 1 ,
112938f344dSjdolecek.Xr pathconf 2 ,
113938f344dSjdolecek.Xr stat 2
114938f344dSjdolecek.Sh STANDARDS
115938f344dSjdolecekThe
116938f344dSjdolecek.Nm
117938f344dSjdolecekutility conforms to
118938f344dSjdolecek.St -p1003.1-2001 .
119938f344dSjdolecek.Sh HISTORY
120938f344dSjdolecekA
121938f344dSjdolecek.Nm
122938f344dSjdolecekutility appeared in
12360805679Sjdolecek.Nx 2.0 .
124