comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: current directory
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: current directory [message #34277 is a reply to message #34275] Mon, 03 March 2003 09:05 Go to previous messageGo to previous message
JD Smith is currently offline  JD Smith
Messages: 850
Registered: December 1999
Senior Member
On Sat, 01 Mar 2003 07:06:25 -0700, Ulf-Dietrich Braumann wrote:

> Hi,
>
> I wonder if there is some elegant way in IDL to i) determine the
> directory where the current running *.pro file
> is stored in order to
> ii) directly access some other stuff (i.e. images) just placed
> in the same directory as the "calling" *.pro
>
> Thanks and greetings
>
> Ulf-Dietrich

If you're trying to do what I think you're trying to do, here's the recipe
I always use:

source=(routine_info('my_routine',/SOURCE)).PATH
dir=strmid(source,0,strpos(source,path_sep(),/REVERSE_SEARCH ))

It should even be platform independent. You can use the callstack
stuff to find out the calling routine's name programmatically, to
replace "my_routine".

That said, I'm not sure how good of an idea it is to use the code
directories for data storage. You don't want people poking around in
there too much. I use this technique for reading in static data
bundled with the code, but never for writing.

JD
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: dynamically naming variables
Next Topic: dlm returning ptr array and string array

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 23:07:09 PDT 2025

Total time taken to generate the page: 0.64126 seconds