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 #50909] Mon, 23 October 2006 14:21 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
JD Smith writes:

> I use a modification of this method: create a
> little batch file (e.g. project_directory.pro) with something like:
>
> common my_project_dir, proj_dir
> if n_elements(proj_dir) eq 0 then begin
> resolve_routine,'myproj',/NO_RECOMPILE
> proj_dir=(routine_info('myproj',/SOURCE)).PATH
> ps=path_sep()
> if strmid(proj_dir, 0,1) ne ps then $ ;relative filename
> proj_dir=file_expand_path(proj_dir)
> endif
>
> Then in any routine where you need to know the project directory, just
>
> @project_dir
>
> at the top. More real world examples would locate the interesting
> relative paths within the distribution. You can use anything for
> 'myproj', just pick a routine which is in a known useful location. This
> works for source, compiled SAV's, anything. For maximum usefulness, have
> the relative location of the routine (in source distributions) and the
> .sav file (in binary distributions) the same.

I've tried distributing files that I @filename
into the code, but this always causes me grief
when people try to run the code because it requires
that the directory where the @ files are located
be on the PATH (or in the local directory).

For some reason, people with UNIX machines have
a *great* many problems getting their paths set
up properly, in my experience. More often than not,
my files are in 5 different directories on their
machines, and I can easily spend an entire day
getting things on their path sorted out. :-(

> Looks like 1 line to me ;)

I think it was two. But I try not to let the facts
get in the way of making a point, whenever possible. :-)

(For some reason, I was thinking of TV and TVIMAGE
when I wrote that response. It's true that TVIMAGE
uses ONLY built-in IDL commands.)

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[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 15:37:16 PDT 2025

Total time taken to generate the page: 0.00503 seconds