'\"macro stdmacro
.if n .pH g1.ckpath @(#)ckpath	40.15 of 10/10/89
.\" Copyright 1989 AT&T
.nr X
.if \nX=0 .ds x} ckpath 1 "Essential Utilities" "\&"
.if \nX=1 .ds x} ckpath 1 "Essential Utilities"
.if \nX=2 .ds x} ckpath 1 "Essential Utilities" "\&"
.if \nX=3 .ds x} ckpath "Essential Utilities" "" "\&"
.TH \*(x}
.SH NAME
\f4ckpath\f1 \- display a prompt; verify and return a pathname
.SH SYNOPSIS
\f4ckpath\f1 [\f4\-Q\f1] [\f4\-W\f2 width\f1] [\f4\-a\f1|\f4l\f1] [\f4\-b\f1|\f4c\f1|\f4g\f1|\f4y\f1] [\f4\-n\f1|[\f4o\f1|\f4z\f1]]
[\f4\-rtwx\f1] [\f4\-d\f2 default\f1]
.br
[\f4\-h\f2 help\f1] [\f4\-e\f2 error\f1]
[\f4\-p \f2prompt\f1] [\f4\-k\f2 pid\f1 [\f4\-s\f2 signal\f1]]
.sp
\f4errpath\f1 [\f4\-W\f1] [\f4\-a\f1|\f4l\f1] [\f4\-b\f1|\f4c\f1|\f4g\f1|\f4y\f1] [\f4\-n\f1|[\f4o\f1|\f4z\f1]] [\f4\-rtwx\f1] [\f4\-e\f2 error\f1]
.br
\f4helppath\f1 [\f4\-W\f1] [\f4\-a\f1|\f4l\f1] [\f4\-b\f1|\f4c\f1|\f4g\f1|\f4y\f1] [\f4\-n\f1|[\f4o\f1|\f4z\f1]] [\f4\-rtwx\f1] [\f4\-h\f2 help\f1]
.br
\f4valpath\f1 [\f4\-a\f1|\f4l\f1] [\f4\-b\f1|\f4c\f1|\f4g\f1|\f4y\f1] [\f4\-n\f1|[\f4o\f1|\f4z\f1]] [\f4\-rtwx\f1] \f2input\f1
.SH DESCRIPTION
\f4ckpath\f1 prompts a user and validates the response.
It defines, among other things,
a prompt message whose response should be a pathname, text for help and
error messages, and a default value
(which will be returned if the user responds with a carriage return).
.P
The pathname must obey the criteria specified by the first group of options.
If no criteria is defined, the pathname must be for a normal file that does not
yet exist.
If neither \f4\-a\f1 (absolute) or \f4\-l\f1 (relative) is given,
then either is assumed to be valid.
.P
All messages are limited in length to 70 characters and
are formatted automatically.
Any white space used in the definition (including newline) is stripped.
The \f4\-W\f1 option cancels the automatic formatting.
When a tilde is placed at the beginning or end of a message definition,
the default text will be
inserted at that point, allowing both custom text and the default text
to be displayed.
.P
If the prompt, help or error message is not defined, the default message
(as defined under NOTES) will be displayed.
.P
Three visual tool modules are linked to the \f4ckpath\f1 command.
They are
\f4errpath\f1 (which formats and displays an error message),
\f4helppath\f1 (which
formats and displays a help message), and \f4valpath\f1 (which validates a
response).
These modules should be used in conjunction with FACE objects.
In this
instance, the FACE object defines the prompt.
.P
The options and arguments for this command are:
.TP
\f4\-Q\f1
Specifies that quit will not be allowed as a valid response.
.TP
\f4\-W\f1
Specifies that prompt, help and error messages will be formatted to a
line length of \f2width\f1.
.TP
\f4\-a\f1
Pathname must be an absolute path.
.TP
\f4\-l\f1
Pathname must be a relative path.
.TP
\f4\-b\f1
Pathname must be a block special file.
.TP
\f4\-c\f1
Pathname must be a character special file.
.TP
\f4\-g\f1
Pathname must be a regular file.
.TP
\f4\-y\f1
Pathname must be a directory.
.TP
\f4\-n\f1
Pathname must not exist (must be new).
.TP
\f4\-o\f1
Pathname must exist (must be old).
.TP
\f4\-z\f1
Pathname must have a length greater than 0 bytes.
.TP
\f4\-r\f1
Pathname must be readable.
.TP
\f4\-t\f1
Pathname must be creatable (touchable).
Pathname will be created if it does
not already exist.
.TP
\f4\-w\f1
Pathname must be writable.
.TP
\f4\-x\f1
Pathname must be executable.
.TP
\f4\-d\f1
Defines the default value as \f2default\f1.
The default is not validated and so does not have to meet any criteria.
.TP
\f4\-h\f1
Defines the help messages as \f2help\fP.
.TP
\f4\-e\f1
Defines the error message as \f2error\f1.
.TP
\f4\-p\f1
Defines the prompt message as \f2prompt\f1.
.TP
\f4\-k\f1
Specifies that process ID \f2pid\f1 is to be sent a signal if the user chooses
to abort.
.TP
\f4\-s\f1
Specifies that the process ID \f2pid\f1 defined with
the \f4\-k\f1 option is to be
sent signal \f4signal\fP when quit is chosen.
If no signal is specified, \f4SIGTERM\f1 is used.
.TP
.I input
Input to be verified against validation options.
.SH EXIT CODES
.nf
\f40\f1 = Successful execution
\f41\f1 = EOF on input
\f42\f1 = Usage error
\f43\f1 = User termination (quit)
\f44\f1 = Mutually exclusive options
.fi
.SH NOTES
The text of the default messages for \f4ckpath\f1 depends upon 
the criteria options that have been used.
An example default prompt for \f4ckpath\f1
(using the \f4\-a\f1 option) is:
.sp
.in +.25i
\f4Enter a pathname [?,q]:\f1
.in -.25i
.sp
An example default error message  (using the \f4-a\f1 option) is:
.sp
.in +.25i
\f4ERROR - Invalid pathname entered.
A pathname is a filename, optionally preceded by parent directories.\f1
.in -.25i
.sp
An example default help message is:
.sp
.in +.25i
\f4A pathname is a filename, optionally preceded by parent directories.
The pathname you enter:
.br
\(em must contain 1 to {NAME_MAX} characters
.br
\(em must not contain a spaces or special characters\f1
.in -.25i
.P
NAME_MAX is a system variable that is defined in \f4limits.h\f1.
.P
When the quit option is chosen (and allowed), \f4q\f1 is
returned along with the return code \f43\f1.
The \f4valpath\f1 module will not produce any output.
It returns zero for success and non-zero for failure.
.\"	@(#)ckpath.1	5.2 of 6/16/87
