[racket] Program compiles with racket fails when invoked with execl()

From: bbi5291 (bbi5291 at gmail.com)
Date: Fri Sep 17 16:45:28 EDT 2010

Ah, thank you for that, it works when I grant execute access to "/" (the
actual filesystem restrictions are actually set by a wrapper program, so
this isn't an issue). However, I notice that the executed program
"aplusb.scm" doesn't inherit stdin/stdout from the calling program, so that
now I can enter "1" and "1" from within DrRacket and it prints "2", but when
I execute it from the command line all I see is "#<procedure:evaluator>". Is
there a way to fix this?

On Fri, Sep 17, 2010 at 4:00 PM, John Clements <clements at brinckerhoff.org>wrote:

>
> On Sep 17, 2010, at 12:31 PM, bbi5291 wrote:
>
> > Thanks for the tip Eli, that seems like what I'm looking for. I can't
> actually figure out how to use it for files though; when I write
> > --------------------
> > (make-evaluator 'racket (string->path "aplusb.scm"))
> > --------------------
> > I get the error message
> > --------------------
> > open-input-file: `read' access denied for aplusb.scm"
>
> I believe in this case the sandbox is denying you access to read the file.
>  I believe you can equip the sandbox with this privilege, if you like.
>
> > --------------------
> > even though I definitely have read access to this file.
> > If I try
> > --------------------
> > (define aplusb (open-input-file "aplusb.scm"))
> > (make-evaluator 'racket aplusb)
> > --------------------
> > then the error message is
> > --------------------
> > exception raised by error display handler: directory-exists?: `exists'
> access denied for /; original exception raised: module: illegal use (not at
> top-level)
>
> Looks to me like the outer error is caused again by your inability to
> access the file system, in this case because the input port has source
> locations in that file.  The inner error is probably because the evaluator
> isn't expecting to see a 'module' form here.
>
> John
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20100917/2e012577/attachment.html>

Posted on the users mailing list.