Why multiple spool files?

David Collier-Brown davecb at Canada.Sun.COM
Mon Mar 23 15:33:53 GMT 1998

Jonathan Crompton wrote:
> On Fri, 20 Mar 1998 09:16:35 EST
> David Collier-Brown <davecb at Canada.Sun.COM> wrote:
> >       Assuming that's correct (and I strongly suspect it is), and
> >       assuming you're using the lpr (as opposed to lp) command,
> >       try "/usr/ucb/lpr -s -P%p %s; rm %s"
> I think you will find this will fail.  The rm will delete the file that
> the spooler has a symlink to.  Looking at the lpr manual page
> "/usr/ucb/lpr -r -s -P%p %s" should do the trick.

	Varies with the vendor:  Sun Solaris says

      -s                  Uses full pathnames (as opposed to  sym-
                          bolic  links) to file rather than trying
                          to copy them.  This  means  file  should
                          not  be modified or removed until it has
                          completed  printing.

	My trivial tests show the -r option removes the 
	source file when -s is ued on Solaris, so -r applies
	to -s.  On older systems, -s -r only removes the link.
	(ie, the -r really doesn't apply at all!). Therefor,
	-r -s will do fine on Solaris, but leave junk on other 

	Too little in the spec, too much left to the implementor.
	One of the reasons printing is a pain! 

David Collier-Brown,  | Always do right. This will gratify some people
185 Ellerslie Ave.,   | and astonish the rest.        -- Mark Twain
Willowdale, Ontario   | davecb at hobbes.ss.org, canada.sun.com
M2N 1Y3. 416-223-8968 | http://java.science.yorku.ca/~davecb

More information about the samba mailing list