<div dir="ltr"><div><div>Nothing wrong at all. <br><br>binfmt is both a more complex and a more powerful approach. It could be set up files where one cannot place a hashbang such as zo files or and often is for jar files. While I haven't tried this, imagine you have several cloud servers and wish to "promote" Racket applications and Racket utilities to each. Certainly one could transfer up all the rkt source files OR (modulo our issues) the zo files. Assuming the existence of zo magic values (probably there), then one could drop the zo extension and the racket binaries run as any other command without the original source files.<br>
<br></div>Arbitrary example. I did not not mean using binfmt did anything one could not do already in the Racket tool sphere, such specifying the interpreter in the source file or creating Racket exe or ...<br><br></div>
<div>I just tend to use binfmt for a number of different non-Racket uses so I use it for Racket as well.<br><br></div><div>Sorry for the off-topic-ness. <br></div><br><div><div><br><br></div></div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Wed, May 8, 2013 at 12:47 PM, Manfred Lotz <span dir="ltr"><<a href="mailto:manfred.lotz@arcor.de" target="_blank">manfred.lotz@arcor.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On Wed, 8 May 2013 10:27:09 -0400<br>
Ray Racine <<a href="mailto:ray.racine@gmail.com">ray.racine@gmail.com</a>> wrote:<br>
<br>
> On a tangent, if you run your Racket on Linux (like anyone would use<br>
> anything else :0 ) you can "install" *.rkt files as executables with<br>
> binfmt.<br>
><br>
> Very Short (no validation) Path<br>
><br>
> 1) Create a shell script runracket.rkt in your racket installation<br>
> bin. i.e. /usr/local/racket/bin/runracket<br>
> #! /bin/sh<br>
><br>
> racket -tm $1<br>
><br>
> 2) Use your package manager to install binfmt.<br>
><br>
> 3) Register .rkt files as executables handled by runracket. As root:<br>
><br>
> a) cd /proc/sys/fs/binfmt_misc/<br>
> b) echo ':RunRacket:E::rkt::/usr/local/racket/bin/runracket:' ><br>
> register<br>
><br>
> 4) Have a sherbet.<br>
><br>
> Then assuming you have a simple helloworld.rkt file with a "main" your<br>
> Racket file is now just another shell or executable.<br>
><br>
> ray@rpr:~$ ./helloworld.rkt<br>
> Hello there.<br>
><br>
> Obviously the above should be made more robust, adjusted be installed<br>
> on bootup etc, but that is the basic idea.<br>
><br>
> Decent odds a Mac can do this as well. Better odds Eli has something<br>
> done along these lines polished to perfection. : )<br>
><br>
> To remove the entry echo -1 to the entry.<br>
><br>
> $ echo -1 RunRacket<br>
><br>
><br>
><br>
<br>
</div></div>Thank you. Didn't know about binfmt.<br>
<br>
<br>
But why not just this:<br>
<br>
#! racket -t<br>
#lang racket<br>
<br>
(displayln "Hi world!")<br>
<br>
<br>
I saved it into rscript.sh, changed perms to 755 and it ran without<br>
problem.<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
--<br>
Manfred<br>
<br>
<br>
<br>
____________________<br>
Racket Users list:<br>
<a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
</div></div></blockquote></div><br></div>