<br><div class="gmail_quote">On Wed, Sep 30, 2009 at 6:13 AM, Jakub Piotr Cłapa <span dir="ltr"><<a href="mailto:jpc-ml@zenburn.net">jpc-ml@zenburn.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">On 09-09-30 14:39, Stephen De Gabrielle wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi, I want to include a binary in a module, that I call with (system<br>
command), except I don't know to reference it, as current-directory is<br>
the users home dir& none of the others that I found seem to do the<br>
job. The idea is to package win, osx and Linux binaries in the module.<br>
</blockquote>
<br></div>
Perhaps define-runtime-path would help?<br>
<br>
This expects the binaries in the same directory as the module. It also works with Create Executable:<br>
(define-runtime-path *sepack-path* (case (system-type)<br>
[(macosx) "./sepack"]<br>
[(windows) "sepack.exe"]))<br></blockquote><div><br>Another way is to use this-expression-source-directory in mzlib/etc <br><br>(require mzlib/etc) <br>(define path (build-path (this-expression-source-directory) ...)) <br>
<br>Also should you prefer - you can make use of bzlib/os, which helps simplify the writing of the system-type case statements:<br><br>(require (planet bzlib/os)) <br>(define-runtime-path path (+:windows "sepack.exe" "sepack")) ;; windows => sepack.exe; else => sepack<br>
<br>Cheers,<br>yc<br><br></div></div>