Path: 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> Reply-To: paolucci@snll-arpagw.UUCP (Sam Paolucci) Organization: Sandia National Labs, Livermore, CA Lines: 55 In article 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 ->#include -> ->#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