6.1 vs. previous: runtime changes working directory [message #43213] |
Thu, 24 March 2005 14:44  |
Vince Hradil
Messages: 574 Registered: December 1999
|
Senior Member |
|
|
I typically deploy programs by creating a .sav file then using a
shell-script to run: idl -rt=/usr/local/idlsavs/whatever.sav
In the main program in the sav file, I check to see if the user started
idl from within our "data" directory hierarchy, something like:
cd, current=cwd
if strpos(cwd,datadirpath) ge 0 then fpath=cwd else fpath=datadirpath
Then I can use this info for my dialog_pickfile:
fname = dialog_pickfile(path=fpath)
And the user doesn't have to navigate through multiple layers of
subdirectories, just to get to where he started.
In previous versions of idl (oh, say 5.4 - 6.0?) this worked fine.
I've just now recompiled in 6.1 and despite starting the program from
within the datadirpath hierarchy, the "cd, current=cwd" sets cwd to be
the directory where the sav file is ("/usr/local/idlsavs" in the
example above)
So, what's my question?
1. Is there a cl flag for idl that will set a working directory - if I
were using Windoze, perhaps I could set "Start in:", but, alas I'm
using Solaris.
2. Is this a feature? If so, why?
TIA
|
|
|
|
|
Re: 6.1 vs. previous: runtime changes working directory [message #43297 is a reply to message #43213] |
Fri, 25 March 2005 08:55  |
R.Bauer
Messages: 1424 Registered: November 1998
|
Senior Member |
|
|
hradilv wrote:
> I typically deploy programs by creating a .sav file then using a
> shell-script to run: idl -rt=/usr/local/idlsavs/whatever.sav
>
> In the main program in the sav file, I check to see if the user started
> idl from within our "data" directory hierarchy, something like:
>
> cd, current=cwd
> if strpos(cwd,datadirpath) ge 0 then fpath=cwd else fpath=datadirpath
>
> Then I can use this info for my dialog_pickfile:
>
> fname = dialog_pickfile(path=fpath)
>
> And the user doesn't have to navigate through multiple layers of
> subdirectories, just to get to where he started.
>
> In previous versions of idl (oh, say 5.4 - 6.0?) this worked fine.
> I've just now recompiled in 6.1 and despite starting the program from
> within the datadirpath hierarchy, the "cd, current=cwd" sets cwd to be
> the directory where the sav file is ("/usr/local/idlsavs" in the
> example above)
>
> So, what's my question?
> 1. Is there a cl flag for idl that will set a working directory - if I
> were using Windoze, perhaps I could set "Start in:", but, alas I'm
> using Solaris.
> 2. Is this a feature? If so, why?
>
> TIA
A simple workaround could be to set a link of the idl sav program to the
data dir.
cheers
Reimar
--
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
http://www.fz-juelich.de/icg/icg-i/
============================================================ ======
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html
|
|
|