[bug-gs] problem report + workaround for pdfwrite "**** Unable to open the initial device, quitting."

Tony Plate tplate@blackmesacapital.com
Fri, 21 Mar 2003 14:13:27 -0700


--=====================_682055265==_.ALT
Content-Type: text/plain; charset="us-ascii"


------------------------------------------------------------------------
Symptoms:

"gswin32c.exe -dNOPAUSE -dBATCH -sDEVICE=pdfwrite ..." reports:
**** Unable to open the initial device, quitting.

Other devices, including pswrite work fine in the same environment.

Problem is that system environment variable TMPDIR points to a non-existent directory.  

------------------------------------------------------------------------
Ghostscript version (or include output from "gs -h"):

8.00

------------------------------------------------------------------------
Where you got Ghostscript:

www.ghostscript.com

------------------------------------------------------------------------
Hardware system you are using (including printer model if the problem
involves printing):

Compaq EVO W4000

------------------------------------------------------------------------
Operating system you are using:

Windows2000

------------------------------------------------------------------------
If you are using X Windows, and your problem involved output to the
screen, the output from running xdpyinfo and xwininfo:

------------------------------------------------------------------------
C compiler you are using, including its version, if you compiled
Ghostscript yourself:

------------------------------------------------------------------------
If you compiled Ghostscript yourself, changes you made to the makefiles:

------------------------------------------------------------------------
Environment variables:

        GS_DEVICE

        GS_FONTPATH

        GS_LIB

        GS_OPTIONS

------------------------------------------------------------------------
Command line:

$ # Fails with TMPDIR pointing to non-existent directory

$ echo $TMPDIR
/c/Temp/6
$ ls -ld $TMPDIR
ls: /c/Temp/6: No such file or directory
$ ls -l tmp2.pdf
ls: tmp2.pdf: No such file or directory
$ /c/gstools/gs/gs8.00/bin/gswin32c.exe -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=tmp2.pdf c:/cygwin/usr/share/ghostscript/7.05/examples/alphabet.ps
AFPL Ghostscript 8.00 (2002-11-21)
Copyright (C) 2002 artofcode LLC, Benicia, CA.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
**** Unable to open the initial device, quitting.
$ ls -l tmp2.pdf
ls: tmp2.pdf: No such file or directory

$ # Runs OK with TMPDIR pointing to existing directory

$ export TMPDIR=/c/Temp
$ /c/gstools/gs/gs8.00/bin/gswin32c.exe -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sO
utputFile=tmp2.pdf c:/cygwin/usr/share/ghostscript/7.05/examples/alphabet.ps
AFPL Ghostscript 8.00 (2002-11-21)
Copyright (C) 2002 artofcode LLC, Benicia, CA.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Loading URWPalladioL-Ital font from C:\gstools\gs\fonts/p052023l.pfb... 1977816
680090 1456712 170354 1 done.
$ ls -l tmp2.pdf
-rwxrwxrwx    1 tplate   Domain U    13883 Mar 21 13:52 tmp2.pdf*

$ # Runs OK with TMPDIR unset

$ unset TMPDIR
$ rm tmp2.pdf
$ /c/gstools/gs/gs8.00/bin/gswin32c.exe -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sO
utputFile=tmp2.pdf c:/cygwin/usr/share/ghostscript/7.05/examples/alphabet.ps
AFPL Ghostscript 8.00 (2002-11-21)
Copyright (C) 2002 artofcode LLC, Benicia, CA.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Loading URWPalladioL-Ital font from C:\gstools\gs\fonts/p052023l.pfb... 1977816
680090 1456712 170354 1 done.
$ ls -l tmp2.pdf
-rwxrwxrwx    1 tplate   Domain U    13883 Mar 21 13:52 tmp2.pdf*

$ /c/gstools/gs/gs8.00/bin/gswin32c.exe --version
8.00


------------------------------------------------------------------------
URL or FTP location of test files (include the data at the end of this
form if 500K or less):


------------------------------------------------------------------------
Suggested fix, if any:

Either create $TMPDIR or print a more informative error message that will allow the user to correct the problem.

------------------------------------------------------------------------
Other comments:

This problem is very difficult to track down given the error message, and I could find no pages that helped even after much googling (quite a few did mention this error message though, with little resolution of the problem.)  If this bug report were just placed somewhere it could be indexed by google, that would probably allieve the problem.




--=====================_682055265==_.ALT
Content-Type: text/html; charset="us-ascii"

<html>
<br>
<font face="Courier New, Courier">------------------------------------------------------------------------<br>
Symptoms:<br><br>
&quot;gswin32c.exe -dNOPAUSE -dBATCH -sDEVICE=pdfwrite ...&quot;
reports:<br>
**** Unable to open the initial device, quitting.<br><br>
Other devices, including pswrite work fine in the same
environment.<br><br>
Problem is that system environment variable TMPDIR points to a
non-existent directory.&nbsp; <br><br>
------------------------------------------------------------------------<br>
Ghostscript version (or include output from &quot;gs -h&quot;):<br><br>
8.00<br><br>
------------------------------------------------------------------------<br>
Where you got Ghostscript:<br><br>
<a href="http://www.ghostscript.com/" eudora="autourl">www.ghostscript.com<br><br>
</a>------------------------------------------------------------------------<br>
Hardware system you are using (including printer model if the
problem<br>
involves printing):<br><br>
Compaq EVO W4000<br><br>
------------------------------------------------------------------------<br>
Operating system you are using:<br><br>
Windows2000<br><br>
------------------------------------------------------------------------<br>
If you are using X Windows, and your problem involved output to the<br>
screen, the output from running xdpyinfo and xwininfo:<br><br>
------------------------------------------------------------------------<br>
C compiler you are using, including its version, if you compiled<br>
Ghostscript yourself:<br><br>
------------------------------------------------------------------------<br>
If you compiled Ghostscript yourself, changes you made to the
makefiles:<br><br>
------------------------------------------------------------------------<br>
Environment variables:<br><br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>GS_DEVICE<br><br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>GS_FONTPATH<br><br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>GS_LIB<br><br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>GS_OPTIONS<br><br>
------------------------------------------------------------------------<br>
Command line:<br><br>
$ # Fails with TMPDIR pointing to non-existent directory<br><br>
$ echo $TMPDIR<br>
/c/Temp/6<br>
$ ls -ld $TMPDIR<br>
ls: /c/Temp/6: No such file or directory<br>
$ ls -l tmp2.pdf<br>
ls: tmp2.pdf: No such file or directory<br>
$ /c/gstools/gs/gs8.00/bin/gswin32c.exe -dNOPAUSE -dBATCH
-sDEVICE=pdfwrite -sOutputFile=tmp2.pdf
c:/cygwin/usr/share/ghostscript/7.05/examples/alphabet.ps<br>
AFPL Ghostscript 8.00 (2002-11-21)<br>
Copyright (C) 2002 artofcode LLC, Benicia, CA.&nbsp; All rights
reserved.<br>
This software comes with NO WARRANTY: see the file PUBLIC for
details.<br>
**** Unable to open the initial device, quitting.<br>
$ ls -l tmp2.pdf<br>
ls: tmp2.pdf: No such file or directory<br><br>
$ # Runs OK with TMPDIR pointing to existing directory<br><br>
$ export TMPDIR=/c/Temp<br>
$ /c/gstools/gs/gs8.00/bin/gswin32c.exe -dNOPAUSE -dBATCH
-sDEVICE=pdfwrite -sO<br>
utputFile=tmp2.pdf
c:/cygwin/usr/share/ghostscript/7.05/examples/alphabet.ps<br>
AFPL Ghostscript 8.00 (2002-11-21)<br>
Copyright (C) 2002 artofcode LLC, Benicia, CA.&nbsp; All rights
reserved.<br>
This software comes with NO WARRANTY: see the file PUBLIC for
details.<br>
Loading URWPalladioL-Ital font from C:\gstools\gs\fonts/p052023l.pfb...
1977816<br>
680090 1456712 170354 1 done.<br>
$ ls -l tmp2.pdf<br>
-rwxrwxrwx&nbsp;&nbsp;&nbsp; 1 tplate&nbsp;&nbsp; Domain
U&nbsp;&nbsp;&nbsp; 13883 Mar 21 13:52 tmp2.pdf*<br><br>
$ # Runs OK with TMPDIR unset<br><br>
$ unset TMPDIR<br>
$ rm tmp2.pdf<br>
$ /c/gstools/gs/gs8.00/bin/gswin32c.exe -dNOPAUSE -dBATCH
-sDEVICE=pdfwrite -sO<br>
utputFile=tmp2.pdf
c:/cygwin/usr/share/ghostscript/7.05/examples/alphabet.ps<br>
AFPL Ghostscript 8.00 (2002-11-21)<br>
Copyright (C) 2002 artofcode LLC, Benicia, CA.&nbsp; All rights
reserved.<br>
This software comes with NO WARRANTY: see the file PUBLIC for
details.<br>
Loading URWPalladioL-Ital font from C:\gstools\gs\fonts/p052023l.pfb...
1977816<br>
680090 1456712 170354 1 done.<br>
$ ls -l tmp2.pdf<br>
-rwxrwxrwx&nbsp;&nbsp;&nbsp; 1 tplate&nbsp;&nbsp; Domain
U&nbsp;&nbsp;&nbsp; 13883 Mar 21 13:52 tmp2.pdf*<br><br>
$ /c/gstools/gs/gs8.00/bin/gswin32c.exe --version<br>
8.00<br><br>
<br>
------------------------------------------------------------------------<br>
URL or FTP location of test files (include the data at the end of
this<br>
form if 500K or less):<br><br>
<br>
------------------------------------------------------------------------<br>
Suggested fix, if any:<br><br>
Either create $TMPDIR or print a more informative error message that will
allow the user to correct the problem.<br><br>
------------------------------------------------------------------------<br>
Other comments:<br><br>
This problem is very difficult to track down given the error message, and
I could find no pages that helped even after much googling (quite a few
did mention this error message though, with little resolution of the
problem.)&nbsp; If this bug report were just placed somewhere it could be
indexed by google, that would probably allieve the problem.<br><br>
<br><br>
</font></html>

--=====================_682055265==_.ALT--