Summary: | missing EOF in JobServer mode | ||
---|---|---|---|
Product: | Ghostscript | Reporter: | Tobias hain <tobias.hain> |
Component: | PS Interpreter | Assignee: | Alex Cherepanov <alex> |
Status: | RESOLVED INVALID | ||
Severity: | normal | CC: | ray.johnston |
Priority: | P4 | ||
Version: | 8.70 | ||
Hardware: | PC | ||
OS: | Linux | ||
Customer: | Word Size: | --- |
Description
Tobias hain
2010-03-18 21:18:28 UTC
Output file is closed when the output device is closed. For instance, this can happen when the output device goes out of scope and is closed by restore. So the server loop can be modified to install a new device. The base device should be different from the device used in the loop. gs -sDEVICE=nullpage ... (pngalpha) selectdevice <</OutputFile (foo.png)>>setpagedevice % run the file here <04> cvx exec % or just delimit the jobs with 0x04 I don't have a strong opinion about PLRM conformance of our device implementation and would appreciate Ray's comments on the problem. Ghostscript does not close the stdio files. It expects the OS to do this when the process exits. As far as the PLRM job server action, we don't close stdin or stdout because then we would not be able to use those files anymore. There really isn't any way to "transmit and end of file" to stdout or stderr. If you wanted to implement something like TBCP on stdout and stderr, with the complementary protocol in whatever is reading 'fromgs', then you could send and out-of-band logical 'EOF' without actually closing stdout so ghostscript could continue using stdout for the next job received from stdin. After processing from stdin, we do the 'restore', then do the top part of the server loop, continuing to use the stdio files. If you cause Ghostscript to exit, then (presumably) the OS will close the stdout and stderr, but that isn't our concern. Closing the bug for the lack of follow-up and the reasons stated above. |