🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.ghostscript.bug
Article #481

Problems using ghostscript through a pipe

#481
From: Eric Marshall
Date: Mon, 09 Nov 1992 02:37
45 lines
1933 bytes
	I am writing a graphics application which I would like to
use ghostscript to do the actual imaging.  I thought the easiest
way for me to do this was to open a pipe to gs and just write PostScript
to it, but I am having a little trouble with this.  The following is the
program I am using to test my idea.

	#include <stdio.h>
	 
	main()
	{
	  extern char *gets();
	 
	  FILE *gs = popen( "./gs -", "w" );
	  char input_line[ 100 ];
	 
	  while ( gets( input_line ) != NULL ) {
	    fputs( input_line, gs );
	    putc( '\n', gs );
	    fflush( gs );
	  }
	}

	There are two problems that I have.  One is that the input
data doesn't seem to be getting to gs in a timely fashion.  If I
run my test program using the tty as the standard input, none of my
PostScript graphics appear in the ghostscript window as I enter them.
I have to enter EOF and then only some of the graphics appear.  For
example, *half* of a line appears.  If I redirect input from a file,
all is fine.

	I am running on a color Sun SPARCstation 1 running
SunOS 4.1.1 with with ghostscript 2.5.2.

	Thanks in advance.


Eric Marshall
Software Productivity Consortium
SPC Building
2214 Rock Hill Road
Herndon, VA 22070
(703) 742-7153

marshall@software.org
Technical Details
Message-ID: <1992Nov6.171823.28583@software.org>
Path: arc1-ca.pugleaf.net!sparky!uunet!europa.asd.contel.com!emory!swrinde!zaphod.mps.ohio-state.edu!saimiri.primate.wisc.edu!ames!biosci!snorkelwacker.mit.edu!ai-lab!prep.ai.mit.edu!gnulists

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!europa.asd.contel.com!emory!swrinde!zaphod.mps.ohio-state.edu!saimiri.primate.wisc.edu!ames!biosci!snorkelwacker.mit.edu!ai-lab!prep.ai.mit.edu!gnulists
From: marshall@software.org (Eric Marshall)
Newsgroups: gnu.ghostscript.bug,comp.windows.x
Subject: Problems using ghostscript through a pipe
Message-ID: <1992Nov6.171823.28583@software.org>
Date: 9 Nov 92 02:37:12 GMT
Sender: tower@ai.mit.edu
Followup-To: gnu.ghostscript.bug,comp.windows.x
Organization: Software Productivity Consortium, Herndon, Virginia
Lines: 45
Approved: info-gnu@prep.ai.mit.edu
NNTP-Posting-Host: life.ai.mit.edu
To: gnu-ghostscript-bug@virginia.edu