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

Home » Public Forums » archive » Re: path to .sav file
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: path to .sav file [message #50917 is a reply to message #50915] Mon, 23 October 2006 09:06 Go to previous messageGo to previous message
Douglas G. Dirks is currently offline  Douglas G. Dirks
Messages: 10
Registered: October 2006
Junior Member
Ben Tupper wrote:
> greg michael wrote:
>> I'm sure there must be any easy answer to this, but I can't figure it
>> out...
>>
>> If a VM program is run with something like:
>>
>> idl -vm=...path.../myprog.sav
>>
>> how can I get that path from within the program?
>>
>> Greg
>>
> Hello,
>
> I think you want somethong like Jim Pendleton's SOURCEPATH.pro which you
> can find at http://www.ittvis.com/codebank
>
> Ben

ROUTINE_INFO will give you the path to the source of any compiled
routine, provided you know its name, and it works all the way back
to IDL 5.0:

routinepath = ROUTINE_INFO('myprog', /SOURCE)

(assuming that myprog.sav has a main routine called 'myprog'...)

Add in FILE_DIRNAME (IDL 6.0 or later) and you've got what you want,
I think:

routinedir = FILE_DIRNAME(routinepath.path)

You can use the MARK_DIRECTORY keyword to FILE_DIRNAME to get a
trailing directory separator.

Nothing against SOURCEPATH or PROGRAMROOTDIR, but if all you want
is to know the path from which a routine was compiled, you can do
it with IDL internal routines.

Doug
[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
Previous Topic: Retrieving the title of a widget_base after the fact.
Next Topic: sorting string arrays - non alphabetic and user defined order

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

Current Time: Wed Oct 08 19:30:32 PDT 2025

Total time taken to generate the page: 0.00181 seconds