ps2pdf fails if there is no write permission to the current working directory

Bug #26098 reported by Christian Reis
6
Affects Status Importance Assigned to Milestone
ghostscript (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Invoking ps2pdf fails with "Unable to open the initial device". I've done some
googling around and it might be related to missing "Fontmap" files -- I have
none, for instance, in /usr/share/ghostscript/fonts. I may be completely wrong,
though.

Revision history for this message
Senko Rasic (senko) wrote :

Thanks for your bug report.

Unfortunately, there isn't enough info in the report to
locate the bug, so could you please provide the exact
steps to replicate this problem?

Also, please check that:

* you have enough space in your /tmp directory
* if you have TMPDIR environment variable set, it points
  to an existing writable directory (check with: ls -l $TMPDIR)
* you didn't try to process a file located in a directory to
  which you don't have write permissions - ps2pdf tries to save
  the file in the same directory the original is in

These are the common cases of the ps2pdf error you reported.

Revision history for this message
Christian Reis (kiko) wrote :

Maybe you're right. My temp directory and TMPDIR were okay, but maybe I was
trying to produce a PDF in a directory I had no write access to. But honestly,
if that's the case, what sort of error message is that?

Revision history for this message
Carthik Sharma (carthik) wrote :

Thank you for reporting this bug.

Is this still an issue with the latest Dapper for you. It is not an issue for me. If the problem persists, please provide updated info, if any.

Revision history for this message
Christian Reis (kiko) wrote :

Well, when I try to issue a ps2pdf in a directory in which I do not have write access, I get the following message now:

ESP Ghostscript 815.02: **** Could not open the file michy_05_2006.pdf .
**** Unable to open the initial device, quitting.

This is slightly better than originally; it could be better.

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

gs-common has merged into the ghostscript package now.

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

I can reproduce the situation of Christian Reis last comment. ps2pdf requires write access to the current working directory. If the write access is given, it work correctly.

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Christian Reis, have you specified a destination path? Otherwise the resulting PDF goes into the current working directory and so it needs to be writable. With destination path ps2pdf works always for me. Seems to be all OK. closing.

Changed in ghostscript:
status: Needs Info → Fix Released
Revision history for this message
Christian Reis (kiko) wrote :

My concern is that the error message is misleading. If you don't have write access to the directory then it's fine for the operation to fail, but don't say "Unable to open device" then.

Revision history for this message
Micah Cowan (micahcowan) wrote :

Christian, "device" has a special meaning to ghostscript. In this case, it's probably referring to output device.

ps2pdf is just a wrapper around ghostscript which invokes it with a "pdfwrite" output device. If the "pdfwrite" device is then unable to open the requested file, it indicates this by sending an error back up to ghostscript. So, pdfwrite sees the "could not open file" error, and ghostscript sees a "unable to open [pdfwrite] device error."

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.