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

Home » Public Forums » archive » Re: vm cwd in *nix
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: vm cwd in *nix [message #54735] Thu, 05 July 2007 14:58
rclark is currently offline  rclark
Messages: 12
Registered: September 1992
Junior Member
In article <1183642210.113475.30670@q75g2000hsh.googlegroups.com>,
hradilv <hradilv@yahoo.com> wrote:
> On Jul 3, 6:33 pm, "mgal...@gmail.com" <mgal...@gmail.com> wrote:
>> On Jul 3, 4:50 pm, rcl...@hindmost.lpl.arizona.edu (Richard Clark)
>> wrote:
>>
>>> Running it in normal fully interactive idl it works fine but not in
>>> vm. I figured out that this is because the vm comes up in the location
>>> of the .sav file as its current working directory.
>>
>>> Is there an easy way to notify the vm application of the location it
>>> is being started from without the user having to type in
>>> big_long_convoluted_path_name at some point?
>>

> ... the 'cwd' question. I
> too have run into this problem - with IDL changing directory to the
> directory where the .sav file is. For instance. Say the user want to
> start a .sav file to operate on some files in /da/mr/data/. He first
> does, > cd /da/mr/data then runs the program. But the program (the
> sav file) is in /usr/local/savfiles, so when the sav file tries to
> open foo.dat it can't find it.

Yes, the user has been prepositioned in a data directory. A script
fires off the idl -vm command, which includes the fixed path to the
.sav file. The vm session starts up in the directory where .sav file
is located, not the data directory where the idl command was issued to
the shell. When I start idl normally and RESTORE the .sav file and
run it, idl is running in the data directory where I want to be. And I
see that 'idl -rt=...' has the same behavior as the vm startup.


> To circumvent this, I usually wrap the thing in a (bash) shell
> script. I capture $PWD and export the variable, then call idl -vm=/
> usr/local/savfiles/foo.sav

This looks hopeful.

I also see that somewhere shortly after ver 6.0 they added a -args to
the idl command line and a command_line_arguments() function for use
within idl. If this works the way it sounds like, then it would be
just what I'm looking for. In fact, it would be one of the more useful
features they've added in years. Could greatly cut down on all the here
documents and cryptic sed and awk commands needed to generate batch
files. Gotta do some tests to see what's up.

> If anyone from ITT/IDL is out there listening... this used to not be a
> problem, until about v6.0 or maybe 6.1. Before that IDL would not
> have the current working directory as the directory from which idl was
> started. I for one liked it better that way. Maybe it's a limitation
> of the vm?

Nope, starting idl with the '-rt=' argument shows the same behavior.
Although maybe there are other ways of starting an application in rt
mode? This is the first I've done anything with the vm or rt modes of
running idl.

>>> And a related question...
>>
>>> Is there a way to automatically generate a mouse click to get past the
>>> vm startup screen? (again, this is all linux/unix so a non portable
>>> solution is ok)
>>
>> I believe the answer to that is to buy a runtime license.

> I'll agree (mostly) with Mike. The splash screen is there for a
> reason...

So it would seem. Well, at least they don't download ads to you while
you're running it.
Oops, did I say that out loud?

Richard Clark
rclark@lpl.arizona.edu
Re: vm cwd in *nix [message #54747 is a reply to message #54735] Thu, 05 July 2007 06:30 Go to previous message
Vince Hradil is currently offline  Vince Hradil
Messages: 574
Registered: December 1999
Senior Member
On Jul 3, 6:33 pm, "mgal...@gmail.com" <mgal...@gmail.com> wrote:
> On Jul 3, 4:50 pm, rcl...@hindmost.lpl.arizona.edu (Richard Clark)
> wrote:
>
>> I'm developing a tool for use in an application (and on workstation)
>> that doesn't otherwise use idl so I'm hoping to run it in the idl
>> virtual machine.
>
>> Running it in normal fully interactive idl it works fine but not in
>> vm. I figured out that this is because the vm comes up in the location
>> of the .sav file as its current working directory.
>
>> Is there an easy way to notify the vm application of the location it
>> is being started from without the user having to type in
>> big_long_convoluted_path_name at some point?
>
> Do you mean start with a given current directory or just to know what
> directory it is started from?
>
> If you just want to know where you are starting from, everyone seems
> to have their own version, mine is:
>
> http://michaelgalloy.com/wp-content/uploads/2007/07/mg_src_r oot.pro
>
> Called from a routine, it will return the directory of the .pro
> or .sav file where that routine was located.
>
> If you want to start in a given directory, just use CD (the IDL
> routine).
>
>> And a related question...
>
>> Is there a way to automatically generate a mouse click to get past the
>> vm startup screen? (again, this is all linux/unix so a non portable
>> solution is ok)
>> The application mentioned above is semi-interactive and a human is in
>> the loop, but we have a couple of fully automated processing pipelines
>> (multiple, independent instances may be running, each at its own rate)
>> where we would like to use idl but also need to keep costs under
>> control.
>
> I believe the answer to that is to buy a runtime license.
>
>> Has anyone ever translated their documentation about licensing into
>> english?
>
> No.
>
> Mike
> --www.michaelgalloy.com

I'll agree (mostly) with Mike. The splash screen is there for a
reason...

However, I think you missed the point Mike on the 'cwd' question. I
too have run into this problem - with IDL changing directory to the
directory where the .sav file is. For instance. Say the user want to
start a .sav file to operate on some files in /da/mr/data/. He first
does, > cd /da/mr/data then runs the program. But the program (the
sav file) is in /usr/local/savfiles, so when the sav file tries to
open foo.dat it can't find it.

To circumvent this, I usually wrap the thing in a (bash) shell
script. I capture $PWD and export the variable, then call idl -vm=/
usr/local/savfiles/foo.sav

If anyone from ITT/IDL is out there listening... this used to not be a
problem, until about v6.0 or maybe 6.1. Before that IDL would not
have the current working directory as the directory from which idl was
started. I for one liked it better that way. Maybe it's a limitation
of the vm?
Re: vm cwd in *nix [message #54772 is a reply to message #54747] Tue, 03 July 2007 16:33 Go to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On Jul 3, 4:50 pm, rcl...@hindmost.lpl.arizona.edu (Richard Clark)
wrote:
> I'm developing a tool for use in an application (and on workstation)
> that doesn't otherwise use idl so I'm hoping to run it in the idl
> virtual machine.
>
> Running it in normal fully interactive idl it works fine but not in
> vm. I figured out that this is because the vm comes up in the location
> of the .sav file as its current working directory.
>
> Is there an easy way to notify the vm application of the location it
> is being started from without the user having to type in
> big_long_convoluted_path_name at some point?

Do you mean start with a given current directory or just to know what
directory it is started from?

If you just want to know where you are starting from, everyone seems
to have their own version, mine is:

http://michaelgalloy.com/wp-content/uploads/2007/07/mg_src_r oot.pro

Called from a routine, it will return the directory of the .pro
or .sav file where that routine was located.

If you want to start in a given directory, just use CD (the IDL
routine).

> And a related question...
>
> Is there a way to automatically generate a mouse click to get past the
> vm startup screen? (again, this is all linux/unix so a non portable
> solution is ok)
> The application mentioned above is semi-interactive and a human is in
> the loop, but we have a couple of fully automated processing pipelines
> (multiple, independent instances may be running, each at its own rate)
> where we would like to use idl but also need to keep costs under
> control.

I believe the answer to that is to buy a runtime license.

> Has anyone ever translated their documentation about licensing into
> english?


No.

Mike
--
www.michaelgalloy.com
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: format string with many many quotation marks
Next Topic: ^_^Keyboard Events question!

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

Current Time: Thu Oct 09 11:23:29 PDT 2025

Total time taken to generate the page: 0.56167 seconds