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

Home » Public Forums » archive » Re: Determining install directory
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: Determining install directory [message #43926 is a reply to message #43925] Tue, 03 May 2005 15:06 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
I M Chapman writes:

> I am writing an application for the IDL Virtual Machine. Some of the
> inputs to the application will come from variables that I will store on
> the users' hard drives.
>
> Now, assuming that I allow a user to install the app wherever they want
> on their system, is there any way to detect where the data directory
> is? I assume that it will involve some sort of findfile command, but I
> can't seem to work it out.

I presume the "data" directory is related to the "install"
directory in some way, perhaps a sub-directory of it. If so,
then ProgramRootDir on my web page is useful. It can tell you
the directory where the current program is running (or, with
the optional ONEUP keyword, the one above the one where the
source code is running.

I write my applications so they can be installed in any user
directory. When they install they set up, for example, a "source"
sub-directory and a "data" sub-directory. To locate a file in
the data directory, say the file logo.jpg, I would do something
like this in any one of the source files:

logoFile = Filepath(Root_Dir=ProgramRootDir(/Oneup), $
Subdir=['data'], 'logo.jpg')

Or, because usually the project builds the save file I want to
run on the VM in the "install" directory, I might do this:

logoFile = Filepath(Root_Dir=ProgramRootDir(Oneup=LMGR(/VM) NE 1), $
Subdir=['data'], 'logo.jpg')

You can find the ProgramRootDir program here:

http://www.dfanning.com/programs/programrootdir.pro


> Also, can the VM distinguish between a windows system and a Unix
> system? This will be important so that I can adjust the file calls to
> reflect the different file systems.

Whoops! I hope you are already specifying filenames in a machine-
independent way. That's what FILEPATH is used for. :-)

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: Tricky data-summing question
Next Topic: wrong results...

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

Current Time: Thu Oct 09 21:59:42 PDT 2025

Total time taken to generate the page: 1.03908 seconds