Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.postscript > #1162

Re: How can I overwrite existing files with new input to running Ghostscript?.

From "luser.droog" <luser.droog@gmail.com>
Newsgroups comp.lang.postscript
Subject Re: How can I overwrite existing files with new input to running Ghostscript?.
Date 2012-12-09 18:28 -0600
Organization unorganized
Message-ID <ka3ac1$ehv$1@dont-email.me> (permalink)
References <f6b4b79d-2be2-419a-be53-630ffe54dc66@googlegroups.com> <aikd7fFr4h9U1@mid.individual.net> <9ae6d1f7-5146-430f-b1f1-75d8d64fd86c@googlegroups.com>

Show all headers | View raw


Ernie Kent wrote:

> On Sunday, December 9, 2012 4:13:17 PM UTC-5, Helge Blischke wrote:
>> Ernie Kent wrote:
>> 
>> 
>> 
>> > I need Ghostscript to repeatedly write small, jpg images rapidly to the
>> 
>> > same file from PS or EPS input on STDIN. Once Ghostscript is up and
>> 
>> > running it takes an acceptable time to create my images. However, to
>> 
>> > repeatedly start Ghostscript and have it do the same job, quit and
>> > restart
>> 
>> > again is taking too long. I need to understand how to get Ghostscript
>> > to
>> 
>> > write a Postscript page to a jpg file, stay running and accept another
>> 
>> > Postscript page description from STDIN, write that to the same file,
>> 
>> > overwriting the first, and repeat that cycle indefinitely until told to
>> 
>> > quit. (This is all on a Linux machine by the way.)
>> 
>> > 
>> 
>> > I've been knocking my head against this, and finding the documentation
>> > not
>> 
>> > very helpful. The -dJOBSERVER switch looks like it should do something
>> 
>> > like the desired operation but I can't get it to. Can you give me any
>> > help
>> 
>> > to get on the right track?
>> 
>> 
>> 
>> Look at the device parameter
>> 
>> OutputFile <string>
>> 
>> which can be used as a key / value pair in the pagedevice dictionary.
>> 
>> Depending on how your input is irganized, you may need to intercept
>> showpage
>> 
>> to close the current output file and open a new one.
>> 
>> 
>> 
>> Helge
> 
> Thanks. Since I want to write over the same file each time, I assume I'd
> just leave the string alone, but you're saying I would need to close the
> file before writing another page over it? Can you point me to some
> information on how to do that? Ernie

That's the crux of the issue. If you're running the interpreter
continuously, "each time" needs more precise definition.
Normally, writing and closing a file makes the data available to other
processes through the filename. But if it stays open, when should (can)
others access the data? Simply in order to rewind the file in postscript
you need to

  File closefile
  /File Filename (r) file def

That is, close it and open it again.

Back to comp.lang.postscript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

How can I overwrite existing files with new input to running Ghostscript?. Ernie Kent <ernie@erniekent.com> - 2012-12-09 10:14 -0800
  Re: How can I overwrite existing files with new input to running Ghostscript?. Helge Blischke <h.blischke@acm.org> - 2012-12-09 22:13 +0100
    Re: How can I overwrite existing files with new input to running Ghostscript?. Ernie Kent <ernie@erniekent.com> - 2012-12-09 13:52 -0800
      Re: How can I overwrite existing files with new input to running Ghostscript?. "luser.droog" <luser.droog@gmail.com> - 2012-12-09 18:28 -0600
        Re: How can I overwrite existing files with new input to running Ghostscript?. Ernie Kent <ernie@erniekent.com> - 2012-12-09 17:11 -0800
  Re: How can I overwrite existing files with new input to running Ghostscript?. SaGS <sags5495@gmail.com> - 2012-12-09 20:24 -0800
    Re: How can I overwrite existing files with new input to running Ghostscript?. Ernie Kent <ernie@erniekent.com> - 2012-12-10 07:00 -0800
      Re: How can I overwrite existing files with new input to running Ghostscript?. Ernie Kent <ernie@erniekent.com> - 2012-12-10 12:39 -0800
        Re: How can I overwrite existing files with new input to running Ghostscript?. Chris <cjl@spamcop.net> - 2012-12-11 10:12 +0000
          Re: How can I overwrite existing files with new input to running Ghostscript?. Ernie Kent <ernie@erniekent.com> - 2012-12-11 11:04 -0800
            Re: How can I overwrite existing files with new input to running Ghostscript?. Chris <cjl@spamcop.net> - 2012-12-12 07:41 +0000
              Re: How can I overwrite existing files with new input to running Ghostscript?. SaGS <sags5495@gmail.com> - 2012-12-12 03:52 -0800
                Re: How can I overwrite existing files with new input to running Ghostscript?. Chris <cjl@spamcop.net> - 2012-12-12 12:52 +0000
                Re: How can I overwrite existing files with new input to running Ghostscript?. Ernie Kent <ernie@erniekent.com> - 2012-12-12 08:45 -0800
                Re: How can I overwrite existing files with new input to running Ghostscript?. Chris <cjl@spamcop.net> - 2012-12-13 14:07 +0000
        Re: How can I overwrite existing files with new input to running Ghostscript?. SaGS <sags5495@gmail.com> - 2012-12-11 02:44 -0800
          Re: How can I overwrite existing files with new input to running Ghostscript?. Ernie Kent <ernie@erniekent.com> - 2012-12-11 11:05 -0800
          Re: How can I overwrite existing files with new input to running Ghostscript?. Ernie Kent <ernie@erniekent.com> - 2012-12-11 12:37 -0800
          Re: How can I overwrite existing files with new input to running Ghostscript?. Ernie Kent <ernie@erniekent.com> - 2012-12-21 21:40 -0800
            Re: How can I overwrite existing files with new input to running Ghostscript?. SaGS <sags5495@gmail.com> - 2012-12-22 00:53 -0800
              Re: How can I overwrite existing files with new input to running Ghostscript?. Ernie Kent <ernie@erniekent.com> - 2012-12-22 09:00 -0800
                Re: How can I overwrite existing files with new input to running Ghostscript?. Ernie Kent <ernie@erniekent.com> - 2012-12-22 19:37 -0800
                Re: How can I overwrite existing files with new input to running Ghostscript?. Chris <cjl@spamcop.net> - 2012-12-23 17:16 +0000
                Re: How can I overwrite existing files with new input to running Ghostscript?. SaGS <sags5495@gmail.com> - 2012-12-23 10:16 -0800
                Re: How can I overwrite existing files with new input to running Ghostscript?. luser- -droog <mijoryx@yahoo.com> - 2012-12-24 19:37 -0800

csiph-web