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

Home » Public Forums » archive » Re: 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
Re: 6.1 vs. previous: runtime changes working directory [message #43199] Fri, 25 March 2005 08:17 Go to next message
Michael Wallace is currently offline  Michael Wallace
Messages: 409
Registered: December 2003
Senior Member
> Yes! Thanks - that's it. (Still... a bit kludgey?)

Very much kludgey. I had hoped that someone with a smarter answer would
have responded by now...

-Mike
Re: 6.1 vs. previous: runtime changes working directory [message #43200 is a reply to message #43199] Fri, 25 March 2005 08:01 Go to previous messageGo to next message
Vince Hradil is currently offline  Vince Hradil
Messages: 574
Registered: December 1999
Senior Member
Yes! Thanks - that's it. (Still... a bit kludgey?)
Re: 6.1 vs. previous: runtime changes working directory [message #43204 is a reply to message #43200] Thu, 24 March 2005 16:32 Go to previous messageGo to next message
Michael Wallace is currently offline  Michael Wallace
Messages: 409
Registered: December 2003
Senior Member
> I tried that already - it gives the same answer.
>
> The directory is correct when I'm in "interactive" idl, but NOT for
> runtime.

Could you wrap your IDL call in a shell script where you also set your
own environmental variable and use that instead? For example,

$ export CWD=$PWD && idl
IDL> cwd = getenv('CWD')

-Mike
Re: 6.1 vs. previous: runtime changes working directory [message #43205 is a reply to message #43204] Thu, 24 March 2005 16:15 Go to previous messageGo to next message
Vince Hradil is currently offline  Vince Hradil
Messages: 574
Registered: December 1999
Senior Member
I tried that already - it gives the same answer.

The directory is correct when I'm in "interactive" idl, but NOT for
runtime.
Re: 6.1 vs. previous: runtime changes working directory [message #43207 is a reply to message #43205] Thu, 24 March 2005 15:27 Go to previous messageGo to next message
Michael Wallace is currently offline  Michael Wallace
Messages: 409
Registered: December 2003
Senior Member
> 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?

Someone else would have to answer the "is this a feature" question. An
ugly work-around would be to pull the environmental variable
corresponding to the system's current working directory and start from
there. I only say it's ugly because you have to directly rely on an
environmental variable and just never like having to write code that
might not transfer cleanly if you change the machine that it's running on.

I can get the current working directory on my system with:
cwd = getenv('PWD')

Don't know if that helps or not.

-Mike
Re: 6.1 vs. previous: runtime changes working directory [message #43287 is a reply to message #43204] Fri, 25 March 2005 16:01 Go to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
Michael Wallace wrote:

>> I tried that already - it gives the same answer.
>>
>> The directory is correct when I'm in "interactive" idl, but NOT for
>> runtime.
>
> Could you wrap your IDL call in a shell script where you also set your
> own environmental variable and use that instead? For example,
>
> $ export CWD=$PWD && idl
> IDL> cwd = getenv('CWD')
>
> -Mike

It's not necessary to make an additional export

pro testme
print,getenv('PWD')
end

IDL> compile,'testme'
IDL> exit
> cd Documents
> idl -rt='../testme.sav'
% Restored file: IDLRTMAIN.
/home/me/Documents

compile is from our library. We have included a history function to show
what's all is in the sav file.

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: getting y Coordinates of NetCDF file
Next Topic: 6.1 vs. previous: runtime changes working directory

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

Current Time: Sat Oct 11 15:40:32 PDT 2025

Total time taken to generate the page: 1.19801 seconds