🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.postscript
Article #8334

Re: PS libraries

#8334
From: Sam Paolucci
Date: Mon, 01 May 1989 15:22
55 lines
2342 bytes
In article <NELSON.89May1004223@sun.soe.clarkson.edu> nelson@clutx.clarkson.edu writes:
->In article <98@snll-arpagw.UUCP> paolucci@snll-arpagw.UUCP (Sam Paolucci) writes:
->
->   In article <783@adobe.UUCP> greid@adobe.COM (Glenn Reid) writes:
->   ->Anyway, forgive my impatience with the ^D issue.  It is a plague on
->   ->portability and on the world.
->
->   Also if the output is redirected to a file, and later the PC
->   user decides to copy the file directly to the serial device, again we
->   have no end of file.
->
->#include <stdio.h>
->#include <gnu_general_license.h>
->
->#define PRINTER	"prn"
->
->main()
->{
->	int c;
->	FILE *printer;
->
->	if ((printer = fopen(PRINTER,"w")) == NULL) {
->		fprintf(stderr, "Uh-oh, you don't have a printer.");
->		exit(1);
->	}
->	while ((c = getc(stdin)) != EOF) {
->		putc(c, printer);
->	}
->	putc(4, printer);
->	fclose(printer);
->}
->
->Problem solved.  Now you just have to teach your applications that emit
->PS to append a ^D if stdout is a device.  On MS-LOSS it looks something
->like this:
->
->	if (isatty(stdout))
->		putc(4, stdout);

I had only a three line script that accomplished the same thing.  But it
doesn't solve the problem since a user can redirect stdout to a file, and
the if he uses the above routine to print it out, he than has not 1, but
2 ^D's, one in the file, and one appended when he prints it out.

The right answer is to have a print spooler.  This would solve all the
problems.  But until that happens, I think it is proper to generate the
PostScript files with a ^D at the end on machines that have a DEDICATED
(non shared) PostScript printer.


-- 
					-+= SAM =+-
"the best things in life are free"

				ARPA: paolucci@snll-arpagw.llnl.gov
Technical Details
Message-ID: <109@snll-arpagw.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!lll-winken!snll-arpagw!paolucci
References: <2994@daisy.UUCP> <775@adobe.UUCP> <8751@polya.Stanford.EDU> <783@adobe.UUCP> <98@snll-arpagw.UUCP> <NELSON.89May1004223@sun.soe.clarkson.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!lll-winken!snll-arpagw!paolucci
From: paolucci@snll-arpagw.UUCP (Sam Paolucci)
Newsgroups: comp.lang.postscript
Subject: Re: PS libraries
Message-ID: <109@snll-arpagw.UUCP>
Date: 1 May 89 15:22:53 GMT
References: <2994@daisy.UUCP> <775@adobe.UUCP> <8751@polya.Stanford.EDU> <783@adobe.UUCP> <98@snll-arpagw.UUCP> <NELSON.89May1004223@sun.soe.clarkson.edu>
Reply-To: paolucci@snll-arpagw.UUCP (Sam Paolucci)
Organization: Sandia National Labs, Livermore, CA
Lines: 55