Open System Services Programmer's Guide
print $[pname]
[#if not [#variableinfo /existence/ [pname]^status] |then|
== print complained that the process died. Bail-out now
#unframe
#return
] == end if not variableinfo /existence/ pname^status then
] == end if
] == end loop
#unframe
== Inform previously defined OSSTTY/OSS shell environment of
== prompt outstanding
?section reset routine
#frame
#push pname
#if [#argument /value pname/ processname]
#chardel pname 1 for 1
[#if not [#variableinfo /existence/ [pname]^in^buf] |then|
#output Process not known.
#output
#unframe
#return
] == end if
#set [pname]^need^prompt 0
#unframe
Printer I/O
The OSS API has no function that accesses printers or spoolers directly. You cannot write directly
to printers with the OSS API. To print from an OSS program or get information about a print job,
you access the Guardian spooler with the lp or lpstat utility.
You can, however, write OSS files and output directly to a printer or to the Guardian spooler using
the Guardian API, as described later in this subsection.
Printing With the OSS API
There are no OSS functions that have direct access to a printer or printer spooler. To print an OSS
file from a program, you can use the popen() function to call the lp or lpstat utility. For
information about these utilities, refer to the lp(1) and lpstat(1) reference pages either online
or in the Open System Services Shell and Utilities Reference Manual, or refer to the Open System
Services User’s Guide.
Example 52 shows how to print to the default printer with a program. It generates text that is output
to the default printer using the popen() function. The contents of the specified input pathname is
printed on the default line printer with its name on the banner page.
226 Managing I/O