The following quad functions are defined under Unix \s-2APL\s0:
.IP "Lcr 'name'" 24
The result of "Lcr" is a character array
containing the function whose name is
passed as an argument.
.IP "Lfx newfn" 24
The contents of the character array
specified as an argument are fixed as
an \s-2APL\s0 function.
.IP "Lrun 'unix command'" 24
The argument passed to "Lrun" is executed
as a Unix shell command
.IP "Lfork xx" 24
"xx" is a dummy argument.  A "fork" system
call is performed.  This quad function
should be used by experienced Unix users
only and probably will be followed by a
"Lexec" quad function.  The process-id
of the child is returned to the parent;
a zero is returned to the child.
.IP "Lexec matrix" 24
Takes a two-dimensional character matrix
and formats it into a Unix "exec" system
call.  The matrix passed as an argument
must be two-dimensional, the rows must
be \fIzero\fR terminated.  This quad function
should be used by experienced Unix users
only.
.IP "Lwait xx" 24
This quad function is used in conjunction
with "Lfork" -- it returns a 3-element
vector of information about a child
process which has terminated.  The first
element is either the PID of a completed
child process or -1 (no children).  The
second is the status of the dead PID and
the last is the completion code.  This
quad function should be used by experienced
Unix users only.
.IP "Lexit code" 24
This quad function is used to terminate
the execution of the current process,
with the completion code "code".  It should
be used to terminate child processes and
can be used to terminate an \s-2APL\s0 session;
however, it is recommended that "Lexit" be
used by experienced Unix users only.
.IP "Lpipe xx" 24
This quad function can be used to set up
a pipe (used for interprocess communication)
It returns a 2-element vector containing
the two "pipe" file descriptors.
.IP "Lchdir 'directory'" 24
This quad function can be used to change
\s-2APL\s0 to another directory.  Normally, \s-2APL\s0
runs in the directory that you were in
when it was started by the "apl" command.
This function changes \s-2APL\s0 to another
directory.  The argument is a character
vector specifying the new directory (there
is NO way to default this).  A 0 is returned
if the "chdir" was successful; a -1 is
returned if it failed.
.IP "mode Lopen 'file'" 24
This function is dyadic.  It opens a Unix
file for use by an \s-2APL\s0 function with calls
via "Lread" and "Lwrite".  The first
argument is the mode for the open (0=read,
1=write, 2=read/write).  The second
argument is a character vector containing
the file name.  The file descriptor of the
opened file is returned (-1 for error).
.IP "Lclose fd" 24
This function complements "Lopen".  The
argument is the file descriptor of a Unix
file to be closed.  This function returns
0 for success or -1 for failure.
.IP "mode Lcreat 'file'" 24
This function creates a Unix file.  If the
file already exists, it is truncated to zero
length.  The creation mode is specified as
the first argument (see CHMOD(I) for mode
description).  The filename is specified
in a character vector as the second argument.
The file descriptor of the created file (or
-1 for error) is returned.
.IP "fd Lread nbytes" 24
This function reads a specified number
of bytes from a designated file.  The
first argument is the file descriptor;
the second is the number of bytes to be
read.  The data which is read is returned.
Note that the returned vector is always
character data -- to convert to numeric
format see the function "Lfloat".
.IP "fd Lwrite data" 24
This function writes data to a specified
file.  The first argument is the file
descriptor; the second is the data to be
written.  The number of bytes written is
returned as the count.  Any type of data
(character or numeric) may be written in
this manner.
.IP "Lseek (fd,pos,mode)" 24
This function executes the "seek" system
call on a Unix file.  The argument to
"Lseek" is a three-element vector containing
the file descriptor, seek offset, and mode
(see SEEK (II)).  A 0 is returned for
a successful seek; -1 is returned if an
error is detected.
.IP "pid Lkill signal" 24
This function executes the "kill" system
call.  The first argument specifies what
process is to be signalled.  The second
argument specifies what signal is to be
sent.  A 0 is returned for a successful
"kill"; -1 is returned if the specified
process could not be found or is not
owned by the current user.  For more
information on signals, see KILL (II).
.IP "Lrd fd" 24
This function reads one line from the
file descriptor specified.  If the line
is completely blank, a null string is
returned.  An end-of-file will also return
a null string.  Otherwise, the returned
value is the character string which was
read.
.IP "Lrm 'filename'" 24
The specified file will be removed,
equivalent to )drop filename.  A 0
is returned for a successful remove;
-1 is returned if the file could not be
removed or does not exist.
.IP "Ldup fd" 24
This function executes the "dup" system
call.  It returns an integer number which
may be used as a file descriptor on later
I/O calls.  The new file descriptor
is a duplicate of the argument "fd".  If
the argument file descriptor could not be
duplicated, -1 is returned.
.IP "fd Lap 'string'" 24
This quad function is used to append a
character string onto the end of a Unix
file.  The first argument specifies the
file descriptor of the file (which should
have been opened earlier).  The second
argument is a character array which is
to be appended.  A carriage return is
automatically appended to the end of
each row of the character array when it
is appended to the end of the file.
.IP "Lrline fd" 24
This quad function is identical to "Lrd",
described above.
.IP "Lnc 'arg'" 24
This function can be used to determine what
type of variable an \s-2APL\s0 symbol is.  The
apl symbol must be specified inside quote
marks, as shown.  The returned value will be:
.br
0 -- symbol is undefined
.br
2 -- symbol is a label or variable
.br
3 -- symbol is a function name
.br
4 -- unknown type (should not occur)
.br
.IP "signal Lsig action" 24
This quad function allows signal processing
to be turned on and off under \s-2APL\s0 function
control.  The first argument is the signal
whose processing is to be changed.  The
second argument specifies how the signal
will be processed -- if zero, the signal will
cause termination of \s-2APL\s0 and a possible
core dump; if non-zero, the signal will be
ignored.  Note that the special way in which
interrupts and other signals are processed
by \s-2APL\s0 is turned off by a call to "Lsig"
and cannot be turned back on.  A -1 is
returned on error, a positive number or zero
for success.
.IP "Lfloat charvect" 24
This quad function is useful in conjunction
with "Lwrite" and "Lread".  While any type of
data may be written to a Unix file with
"Lwrite", when it is read with "Lread" it
will be interpreted as character data.  This
function will convert a character array into
numeric form.  The array must be a multiple
of 4 elements long for apl2 and 8 for apl.
The converted array is the returned value.
.LP
