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

Home » Public Forums » archive » 6.1 vs. previous: runtime changes working directory
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
6.1 vs. previous: runtime changes working directory [message #43213] Thu, 24 March 2005 14:44 Go to next message
Vince Hradil is currently offline  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 #43284 is a reply to message #43213] Fri, 25 March 2005 16:08 Go to previous message
Michael Wallace is currently offline  Michael Wallace
Messages: 409
Registered: December 2003
Senior Member
> It's not necessary to make an additional export
>
> pro testme
> print,getenv('PWD')
> end
>

But according to the original poster, this solution did not work.

Cheers,
Mike
Re: 6.1 vs. previous: runtime changes working directory [message #43290 is a reply to message #43213] Fri, 25 March 2005 15:15 Go to previous message
Vince Hradil is currently offline  Vince Hradil
Messages: 574
Registered: December 1999
Senior Member
Yes, of course, but as tried to indicate I'm not always sure where the
user is going to be in the data directory hierarchy. Mike's workaround
works. Now I just have to reprogram myself to remember to
export/getenv the cwd in my wrapper script.
Re: 6.1 vs. previous: runtime changes working directory [message #43297 is a reply to message #43213] Fri, 25 March 2005 08:55 Go to previous message
R.Bauer is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: 6.1 vs. previous: runtime changes working directory
Next Topic: Re: Displaying floating point values with user specified decimal places?

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

Current Time: Sun Oct 12 14:48:04 PDT 2025

Total time taken to generate the page: 1.03868 seconds