pathchk - Check a path name
Format
pathchk [-p] pathname ...
Description
pathchk checks one or more path names (specified by
pathname) for validity and portability (based on the underlying file
system). A path name is valid if you can use it to create or access a file without causing a syntax
error. A path name is portable if the file system does not truncate the name when it tries to use
it. pathchk writes an error message indicating the error that was detected and
the erroneous path name if any path name is longer than PATH_MAX bytes or contains any of the
following:
- A component longer than NAME_MAX bytes.
- Any component in a directory that is not searchable.
- Any character in any component that is not valid.
Options
- -p
- Instead of using the previous criteria, writes an error message
if pathname:
- Is longer than _POSIX_PATH_MAX bytes.
- Contains any component longer than _POSIX_NAME_MAX bytes.
- Contains any character in any component that is not in the portable file name character set.
Localization
pathchk uses
the following localization environment variables:
- LANG
- LC_ALL
- LC_CTYPE
- LC_MESSAGES
- NLSPATH
Exit values
0
- All path names passed the check
1
- An error occurred.
2
- Unknown command-line option.
Portability
POSIX.2, X/Open Portability Guide.