Lisp HUG Maillist Archive

finding executable location of delivered application?

Hi,
I'm planning to deliver an application which will keep the
data next to where the application is located so people
can put the application and the data on a thumbdrive.

I guess I can't use *load-truename* (But I admit I didn't try.)
So how do I find where the application is located at run-time?
LWW 5.0
-- 
  -asbjxrn


Re: finding executable location of delivered application?

On Sunday 03 December 2006 11:20 am, Asbjørn Bjørnstad wrote:
> Hi,
> I'm planning to deliver an application which will keep the
> data next to where the application is located so people
> can put the application and the data on a thumbdrive.
>
> I guess I can't use *load-truename* (But I admit I didn't try.)
> So how do I find where the application is located at run-time?
> LWW 5.0

If you don't explicitly change the working directory, then I think 

(current-pathname)

might do the trick.

pt


Re: finding executable location of delivered application?

> > I'm planning to deliver an application which will keep the
> > data next to where the application is located so people
> > can put the application and the data on a thumbdrive.
> >
> > I guess I can't use *load-truename* (But I admit I didn't try.)
> > So how do I find where the application is located at run-time?
> > LWW 5.0
> 
> If you don't explicitly change the working directory, then I think 
> 
> (current-pathname)
> 
> might do the trick.

Under Windows it's not unusual to have an app start with the working 
directory set elsewhere.

It used to be that under Windows the first element of the command line was 
the executable, including its full path. I think that still works, but if 
it doesn't this is the official solution:

        
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/getprocessimagefilename.asp

This will work with both EXEs and DLLs:

        
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/getmodulefilename.asp

(EXEs are also modules.)

Of course, it's possible that LispWorks already has such functions. I'm 
just talking about what I remember from the old days. :-)


Re: finding executable location of delivered application?


On 3.12.2006, at 18.20, Asbjørn Bjørnstad wrote:

>
> Hi,
> I'm planning to deliver an application which will keep the
> data next to where the application is located so people
> can put the application and the data on a thumbdrive.
>
> I guess I can't use *load-truename* (But I admit I didn't try.)
> So how do I find where the application is located at run-time?
> LWW 5.0
> -- 
>  -asbjxrn

I think (lw::lisp-image-name) should do the trick.

Mika Kuuskankare
Researcher
Department of Doctoral Studies in Musical Performance and Research
Sibelius Academy

Henkilökohtainen postiosoite/Personal post address
PL 342 - PO Box 342
FIN-00121 Helsinki, FINLAND
Tel: +358 (0)40 5415 233
Skype: mkuuskan
home page: www.siba.fi/~mkuuskan





Re: finding executable location of delivered application?

On Mon, 4 Dec 2006 00:20:29 +0800, "Asbjørn Bjørnstad" <asbjxrn@bjxrnstad.net> wrote:

> I'm planning to deliver an application which will keep the data next
> to where the application is located so people can put the
> application and the data on a thumbdrive.
>
> I guess I can't use *load-truename* (But I admit I didn't try.)  So
> how do I find where the application is located at run-time?  LWW 5.0

  http://www.lispworks.com/documentation/lw50/LWRM/html/lwref-317.htm

Cheers,
Edi.


Re: finding executable location of delivered application?

On 12/4/06, Mika Kuuskankare <mkuuskan@siba.fi> wrote:

> On 3.12.2006, at 18.20, Asbjørn Bjørnstad wrote:

> > So how do I find where the application is located at run-time?
> > LWW 5.0
> > --
> >  -asbjxrn
>
> I think (lw::lisp-image-name) should do the trick.

Indeed, this works perfectly. Thanks guys.
-- 
  -asbjxrn


Updated at: 2020-12-10 08:47 UTC