Bug 691743 - Error: /invalidfileaccess in --file--
Summary: Error: /invalidfileaccess in --file--
Status: RESOLVED INVALID
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: PDF Writer (show other bugs)
Version: 9.00
Hardware: PC Windows XP
: P4 normal
Assignee: Ken Sharp
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-02 07:58 UTC by Jinsong Zhao
Modified: 2010-11-02 08:27 UTC (History)
1 user (show)

See Also:
Customer:
Word Size: ---


Attachments
The ps file (38.40 KB, application/postscript)
2010-11-02 07:58 UTC, Jinsong Zhao
Details
the embedded swf file (3.55 KB, application/x-shockwave-flash)
2010-11-02 07:59 UTC, Jinsong Zhao
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jinsong Zhao 2010-11-02 07:58:28 UTC
Created attachment 6859 [details]
The ps file

Hi there,

when I hope to convert a ps file, which produced by LaTeX with beamer class, to a pdf file, a error appeared:

E:\>"d:\Program Files\gs\gs9.00\bin\gswin32c.exe" -q -dSAFER -dNOPAUSE -dBATCH -
sDEVICE=pdfwrite -dUseCIEColor=true -dPDFSETTINGS=/printer -sOutputFile=zz.pdf z
z.ps
Error: /invalidfileaccess in --file--
Operand stack:
   --nostringval--   --nostringval--   (digclock.swf)   (r)
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval-
-   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   fa
lse   1   %stopped_push   1910   1   3   %oparray_pop   1909   1   3   %oparray_
pop   1893   1   3   %oparray_pop   1787   1   3   %oparray_pop   --nostringval-
-   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringv
al--   2   %stopped_push   --nostringval--
Dictionary stack:
   --dict:1160/1684(ro)(G)--   --dict:0/20(G)--   --dict:79/200(L)--   --dict:10
6/300(L)--   --dict:36/200(L)--
Current allocation mode is local
Last OS error: No such file or directory
Current file position is 37829
GPL Ghostscript  9.00: Unrecoverable error, exit code 1

I tested the same ps file with ghostscript 8.71, no error occurred.

Regards,
Jinsong
Comment 1 Jinsong Zhao 2010-11-02 07:59:23 UTC
Created attachment 6860 [details]
the embedded swf file
Comment 2 Ken Sharp 2010-11-02 08:18:36 UTC
This is undoubtedly nothing to do with the PDF writer. I suspect that using the display device would give the same error.

You are using an unqualified path to the file, which means its using the current working directory. There were changes made to the way this works in 9.0 in order to address security concerns.

From gs/doc/Use./htm:

-dSAFER
    Disables the deletefile and renamefile operators, and the ability to open piped commands (%pipe%cmd) at all. Only %stdout and %stderr can be opened for writing. Disables reading of files other than %stdin, those given as a command line argument, or those contained on one of the paths given by LIBPATH and FONTPATH and specified by the system params /FontResourceDir and /GenericResourceDir. 

Since the file you are opening is not %stdin, is not given on the command line, and is not one of the paths specified by system params, SAFER mode disallows opening the file.

Try not using -dSAFER.

Of course if this should not be the problem, please reopen the issue.
Comment 3 Alexander Grahn 2010-11-02 08:27:14 UTC
The  command ps2pdf was probably used for ps to pdf conversion. It automatically sets -dSAFER. To override this, option -dNOSAFER should be set:

ps2pdf -dNOSAFER zz.ps