1
0
Files
irix-657m-src/eoe/man/man1/pathchk.1
2022-09-29 17:59:04 +03:00

89 lines
2.0 KiB
Groff

'\"macro stdmacro
.if n .pH g2.pathchk @(#)pathchk 30.2 of 01/13/96
.TH PATHCHK 1
.SH NAME
pathchk \- check pathnames
.SH SYNOPSIS
.PP
.B "pathchk [-p path]"
.I pathname...
.SH DESCRIPTION
.I pathchk\^
checks that one or more pathnames are valid (that is, they
could be used to access or create a file without causing syntax errors)
and portable (that is, no filename truncation will result).
More extensive portability checks are provided by the \f4-p\fP option.
.PP
By default, the
.I pathchk
utility will check each component of each
.I pathname
operand based on the underlying file system. A diagnostic will be
written for each
.I pathname
operand that:
.sp
\(bu is longer than
.I PATH_MAX
bytes
.sp
\(bu contains any component longer than
.I NAME_MAX
bytes in its
.in+0.4i
containing directory
.in-0.4i
.sp
\(bu contains any in a directory that is not searchable
.sp
\(bu contains any character in any component that is not valid in its
.in+0.4i
containing directory.
.in-0.4i
.PP
The \f4-p\fP option will cause checks to be done on each
.I pathname
operand and a diagnostic message to be written if each of the
.I pathname
operands:
.sp
\(bu is longer than
.I _POSIX_PATH_MAX
bytes
.sp
\(bu contains any component longer than
.I _POSIX_PATH_MAX
bytes
.sp
\(bu contains any character in any comonent that is not in the portable
.in+0.4i
filename character set.
.in-0.4i
.SH "RETURN VALUES"
\f4pathchk\fP exits with a status of greater than 0 if any errors are
encountered, otherwise it exits with status 0.
.PP
If the
.I pathname
argument contains a name that doesn't exist, then this is not considered an
error as long as a file could be created with this name.
.bp
.SH EXAMPLE
To verify that all pathnames in an imported data interchange archive are
legitimate and unambiguous on the current system:
.PP
.nf
.in+0.4i
\f4pax -f archive | sed -e '/ == .*/s///' | xargs pathchk
if [ $? -eq 0 ]
then
pax -r -f archive
else
echo Investigate problems before importing files.
exit 1
fi\fP
.in-0.4i
.fi
.SH "SEE ALSO"
test(1), limits(4)