Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.postscript > #1122 > unrolled thread
| Started by | Cecil Westerhof <Cecil@decebal.nl> |
|---|---|
| First post | 2012-12-02 13:54 +0100 |
| Last post | 2012-12-02 20:01 +0100 |
| Articles | 4 — 2 participants |
Back to article view | Back to comp.lang.postscript
Why is my file access mode wrong Cecil Westerhof <Cecil@decebal.nl> - 2012-12-02 13:54 +0100
Re: Why is my file access mode wrong Cecil Westerhof <Cecil@decebal.nl> - 2012-12-02 14:22 +0100
Re: Why is my file access mode wrong Helge Blischke <h.blischke@acm.org> - 2012-12-02 17:47 +0100
Re: Why is my file access mode wrong Cecil Westerhof <Cecil@decebal.nl> - 2012-12-02 20:01 +0100
| From | Cecil Westerhof <Cecil@decebal.nl> |
|---|---|
| Date | 2012-12-02 13:54 +0100 |
| Subject | Why is my file access mode wrong |
| Message-ID | <87boecehrn.fsf@Compaq.site.inet> |
I am still experimenting with postscript. I now have a script which
starts with:
/inputFile INPUT (r) file def
I call it with:
ps2pdf -sINPUT=quotes.org quote.ps
But get:
Error: /invalidfileaccess in --file--
Operand stack:
inputFile (quotes.org) (r)
Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 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-- --nostringval-- 2 %stopped_push --nostringval--
Dictionary stack:
--dict:1175/3371(ro)(G)-- --dict:0/20(G)-- --dict:77/200(L)--
Current allocation mode is local
Current file position is 26
GPL Ghostscript 9.00: Unrecoverable error, exit code 1
What am I doing wrong?
--
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
[toc] | [next] | [standalone]
| From | Cecil Westerhof <Cecil@decebal.nl> |
|---|---|
| Date | 2012-12-02 14:22 +0100 |
| Message-ID | <877gp0eghu.fsf@Compaq.site.inet> |
| In reply to | #1122 |
Op zondag 2 dec 2012 13:54 CET schreef Cecil Westerhof: > I am still experimenting with postscript. I now have a script which > starts with: > /inputFile INPUT (r) file def > > I call it with: > ps2pdf -sINPUT=quotes.org quote.ps > > But get: > Error: /invalidfileaccess in --file-- > Operand stack: > inputFile (quotes.org) (r) > Execution stack: > %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 > %stopped_push --nostringval-- --nostringval-- --nostringval-- false 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-- --nostringval-- 2 %stopped_push > --nostringval-- > Dictionary stack: > --dict:1175/3371(ro)(G)-- --dict:0/20(G)-- --dict:77/200(L)-- > Current allocation mode is local > Current file position is 26 > GPL Ghostscript 9.00: Unrecoverable error, exit code 1 > > What am I doing wrong? By the way: the script example 7.7 in ‘Thinking in Postscript’ also goes wrong. (What is to be expected, because it does the same.) -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof
[toc] | [prev] | [next] | [standalone]
| From | Helge Blischke <h.blischke@acm.org> |
|---|---|
| Date | 2012-12-02 17:47 +0100 |
| Message-ID | <ai1f17Fgv4nU1@mid.individual.net> |
| In reply to | #1122 |
Cecil Westerhof wrote: > I am still experimenting with postscript. I now have a script which > starts with: > /inputFile INPUT (r) file def > > I call it with: > ps2pdf -sINPUT=quotes.org quote.ps > > But get: > Error: /invalidfileaccess in --file-- > Operand stack: > inputFile (quotes.org) (r) > Execution stack: > %interp_exit .runexec2 --nostringval-- --nostringval-- > --nostringval-- 2 %stopped_push --nostringval-- > --nostringval-- --nostringval-- false 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-- --nostringval-- 2 %stopped_push > --nostringval-- > Dictionary stack: > --dict:1175/3371(ro)(G)-- --dict:0/20(G)-- --dict:77/200(L)-- > Current allocation mode is local > Current file position is 26 > GPL Ghostscript 9.00: Unrecoverable error, exit code 1 > > What am I doing wrong? > the ps2pdf utility calls Ghostscript with the option "-dSAFER" which denies any file operations except for %stdin and %stdout. Helge
[toc] | [prev] | [next] | [standalone]
| From | Cecil Westerhof <Cecil@decebal.nl> |
|---|---|
| Date | 2012-12-02 20:01 +0100 |
| Message-ID | <87ehj8p9ci.fsf@Compaq.site.inet> |
| In reply to | #1125 |
Op zondag 2 dec 2012 17:47 CET schreef Helge Blischke:
>> I am still experimenting with postscript. I now have a script which
>> starts with:
>> /inputFile INPUT (r) file def
>>
>> I call it with:
>> ps2pdf -sINPUT=quotes.org quote.ps
>>
>> But get:
>> Error: /invalidfileaccess in --file--
>> Operand stack:
>> inputFile (quotes.org) (r)
>> Execution stack:
>> %interp_exit .runexec2 --nostringval-- --nostringval--
>> --nostringval-- 2 %stopped_push --nostringval--
>> --nostringval-- --nostringval-- false 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-- --nostringval-- 2 %stopped_push
>> --nostringval--
>> Dictionary stack:
>> --dict:1175/3371(ro)(G)-- --dict:0/20(G)-- --dict:77/200(L)--
>> Current allocation mode is local
>> Current file position is 26
>> GPL Ghostscript 9.00: Unrecoverable error, exit code 1
>>
>> What am I doing wrong?
>>
>
> the ps2pdf utility calls Ghostscript with the option "-dSAFER" which denies
> any file operations except for %stdin and %stdout.
That was the problem. I now use:
gs -dCompatibilityLevel=1.4 \
-q \
-dNOPAUSE \
-dBATCH \
-sDEVICE=pdfwrite \
-sstdout=%stderr \
-sOutputFile=test.pdf \
-c .setpdfwrite \
-f test.ps
The script test.ps is example 7.7 from Thinking in Postscript. After
solving a bug, that works. For closing the file fd is used instead of
datafile. I'll notify glenn@rightbrain.com about it.
--
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.postscript
csiph-web