# Problem with gslp invocation of ghostscript?



## byrnejb (Apr 20, 2021)

FreeBSD-12.2-RELEASE-p3

As part of the ghostscript-9 port when I run `gslp -p out.test sshpipe3.txt` I get this:


```
gslp -p out.test sshpipe3.txt
Error: /undefinedfilename in --file--
Operand stack:
   --nostringval--   (sshpipe3.txt)   (out.test)   ()   (w)
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1974   1   3   %oparray_pop   1973   1   3   %oparray_pop   1961   1   3   %oparray_pop   1817   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   --nostringval--   %loop_continue   --nostringval--
Dictionary stack:
   --dict:739/1123(ro)(G)--   --dict:0/20(G)--   --dict:86/200(L)--   --dict:135/150(L)--
Current allocation mode is local
Current file position is 20728
GPL Ghostscript 9.52: Unrecoverable error, exit code 1
```

I believe that the command line I used is valid.  If it is not then I would appreciate a correction.


----------



## covacat (Apr 20, 2021)

use -pout.test (no spaces)
if you get /invalidfileaccess copy gslp from /usr/local/bin to ~ or /tmp and replace -dSAFER with -dNOSAFER, then run ./gslp -pwhatever.out myfile.txt


----------



## byrnejb (Apr 20, 2021)

I get the same error regardless.  I did copy`/usr/local/bin/gslp` to`~`


```
./gslp -pout.test sshpipe3.txt
Error: /invalidfileaccess in --file--
Operand stack:
   --nostringval--   (sshpipe3.txt)   (out.test)   (w)
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1974   1   3   %oparray_pop   1973   1   3   %oparray_pop   1961   1   3   %oparray_pop   1817   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   --nostringval--   %loop_continue   --nostringval--
Dictionary stack:
   --dict:739/1123(ro)(G)--   --dict:0/20(G)--   --dict:86/200(L)--   --dict:135/150(L)--
Current allocation mode is local
Last OS error: Permission denied
Current file position is 20728
GPL Ghostscript 9.52: Unrecoverable error, exit code 1
```


```
./gslp -dNOSAFER -pout.test sshpipe3.txt
Error: /invalidfileaccess in --file--
Operand stack:
   --nostringval--   (sshpipe3.txt)   (out.test)   (w)
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1974   1   3   %oparray_pop   1973   1   3   %oparray_pop   1961   1   3   %oparray_pop   1817   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   --nostringval--   %loop_continue   --nostringval--
Dictionary stack:
   --dict:739/1123(ro)(G)--   --dict:0/20(G)--   --dict:86/200(L)--   --dict:135/150(L)--
Current allocation mode is local
Last OS error: Permission denied
Current file position is 20728
GPL Ghostscript 9.52: Unrecoverable error, exit code 1
```


----------



## covacat (Apr 20, 2021)

do not use -dNOSAFER on cli. patch the local copy of gslp (which is a shell script which invokes gs)


----------



## byrnejb (Apr 20, 2021)

Thank you, that worked.


----------



## byrnejb (Apr 20, 2021)

Is there any way to get this script to send to STDOUT?


----------



## covacat (Apr 20, 2021)

-p%stdout  but you stll need the nosafer


----------



## byrnejb (Apr 20, 2021)

double thanks


----------



## byrnejb (Apr 20, 2021)

Can you tell me what this means from gslp?

`-- gslp.ps --heading-center "`date`" "$@"`

I can figure out that --heading-center  ... simply puts the current date and time in the center of each page.  But what is `gslp.ps`?


----------



## byrnejb (Apr 20, 2021)

found it: `/usr/local/share/ghostscript/9.54.0/lib/gslp.ps`


----------

