pathchk(1) — Commands
NAME
pathchk − Checks pathnames
SYNOPSIS
pathchk [-p] pathname ...
The pathchk command checks that one or more pathnames are valid (that is, they can be used to access or create a file without causing syntax errors) and portable (that is, no filename truncation will result).
FLAGS
-pPerforms pathname checks based on POSIX portability standards. An error message is sent if any of the following conditions are true:
•The byte length of the full pathname is longer than allowed by POSIX standards (_POSIX_PATH_MAX).
•The byte length of a component is longer than allowed by POSIX standards (_POSIX_NAME_MAX).
•A character in any component is not in the portable filename character set.
DESCRIPTION
By default, the pathchk command checks each component of each pathname specified by the pathname argument based on the underlying file system. If the -p flag is not specified, pathchk sends an error message if any of the following conditions are true:
•The byte length of the full pathname is longer than allowed by the system (PATH_MAX bytes).
•The byte length of a component is longer than allowed by the system (NAME_MAX bytes).
•Search permission is not allowed for a component.
•A character in any component is not valid in its containing directory.
It is not considered an error if one or more components of a pathname do not exist, as long as a file matching the pathname specified by the pathname argument could be created without violating any of the preceding criteria.
EXAMPLES
1.To check the validity and portability of the /u/bob/work/tempfiles pathname, enter:
pathchk /u/bob/work/tempfiles
2.To check the validity and portability of the /u/bob/temp pathname for POSIX standards, enter:
pathchk -p /u/bob/temp
EXIT VALUES
The pathchk command returns the following exit values:
0All pathname operands passed the checks.
>0An error occurred.