PATHCHK(1) PATHCHK(1)
pathchk - check pathnames
pathchk [-p path] pathname...
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 -p option.
By default, the pathchk utility will check each component of each
pathname operand based on the underlying file system. A diagnostic will
be written for each pathname operand that:
o is longer than PATH_MAX bytes
o contains any component longer than NAME_MAX bytes in its
containing directory
o contains any in a directory that is not searchable
o contains any character in any component that is not valid in its
containing directory.
The -p option will cause checks to be done on each pathname operand and a
diagnostic message to be written if each of the pathname operands:
o is longer than _POSIX_PATH_MAX bytes
o contains any component longer than _POSIX_PATH_MAX bytes
o contains any character in any comonent that is not in the portable
filename character set.
pathchk exits with a status of greater than 0 if any errors are
encountered, otherwise it exits with status 0.
If the 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.
Page 1
PATHCHK(1) PATHCHK(1)
To verify that all pathnames in an imported data interchange archive are
legitimate and unambiguous on the current system:
pax -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
test(1), limits(4)
PPPPaaaaggggeeee 2222 [ Back ]
|