Open System Services Shell and Utilities Reference Manual (G06.25+, H06.03+)
Table Of Contents
User Commands (p - r) pathchk(1)
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
-p Performs 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 stan-
dards (_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 violat-
ing 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:
0 All pathname operands passed the checks.
>0 An error occurred.
527188-003 Hewlett-Packard Company 7−11