Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 ggr 02/21/84; site packard.UUCP
Path: utzoo!linus!philabs!cmcl2!seismo!columbia!topaz!packard!ggr
From: ggr@packard.UUCP (Guy Riddle)
Newsgroups: net.unix-wizards
Subject: line-printer spooling to non-tty-like devices
Message-ID: <327@packard.UUCP>
Date: Sun, 11-Aug-85 10:53:32 EDT
Article-I.D.: packard.327
Posted: Sun Aug 11 10:53:32 1985
Date-Received: Tue, 13-Aug-85 03:04:36 EDT
References: <647@adobe.UUCP>
Organization: AT&T Bell Laboratories, Piscataway
Lines: 19

) Both the 4.2BSD and System V line printer spoolers invoke a
) printer-specific interface program with one file descriptor
) already open to "the device" (the printer).  On both systems the
) fd is open for writing, but the documentation states that the
) device can be opened for reading also under certain
) circumstances (specifying "rw" in the BSD printcap entry, or
) having the file (device) readable on SysV); however, you still
) only get one fd when you get called.  You do NOT get passed the
) name of the device (so you can't do your own open(2)).

On System V the interface script can get the name of the printer
by `basename $0` and use it to do an open or set up a network
connection or whatever.  For our network-attached printers, we just
tell lpadmin(1M) that the device to open is /dev/null and the real
open (and connect) is done by the programs invoked by the interface script.

		=== Guy Riddle == AT&T Bell Laboratories, New Jersey ===
				ggr.btl@csnet-relay.ARPA
					ihnp4!ggr