[Developers] More about the custom data directory

Bert Bril Bert.Bril at opendtect.org
Tue Jun 5 13:12:18 CEST 2007


Hi all,

First of all I made a (or rather, at least one) mistake in the text I
posted yesterday. The ID you choose has to be larger than 200000
(instead of > 100000).

Secondly, let me explain a bit more about what I refer to as
'DTECT_DATA'. This reference originates from the name of an environment
variable that, if set, will determine where OpendTect expect its survey
directories. If the variable is not set, then the user settings will be
consulted for 'Default DATA directory'. If that is also not there, the
user will be asked for a directory.

The user can select a new DTECT_DATA from within OpendTect using 'Set
data root' in the survey selection window. That value is then set into
the program's environment variable using SetEnvVar (see envvars.h). In
oddirs.h you'll find a function to get the current value:
const char*     GetBaseDataDir(void);
There is also one that delivers the current survey directory:
const char*     GetDataDir(void);

Thus, beware: if you have an external program communicating with
OpendTect, make sure it gets the right directory. Don't trust that
DTECT_DATA will be correct.


Another thing: contrary to what some may think, your custom data
directory inside DTECT_DATA/[survey_directory] is usable without any
object management. Whatever mess you want to make there: no problem. But
please keep DTECT_DATA/[survey_directory] clean!

Some reasons to use this approach as much as possible:
* It supports object management, and will thus also benefit from any
general-purpose tool that works on it
* It will ensure the directory is created in every survey that is
selected when it does not yet exist
* It keeps your data in a separate scope which is tidy.

I realized, this morning, that you may want to be able to create the
directory outside OpendTect if it doesn't exist. I hadn't thought of
that before, but I made a (small) fix for this which will go into the
stable release. It only adds object management to such a pre-existing
directory (only if it's not yet there of course).


If all goes well, we'll release 3.0.2 this Thursday (that is: June 7).


/Bert

-- 
-- Bert Bril / OpendTect developer at dGB
-- Nijverheidstraat 11-2, 7511 JM Enschede, The Netherlands
-- mailto:Bert.Bril at opendtect.org , http://opendtect.org
-- Tel: +31 534315155 , Fax: +31 534315104




More information about the Developers mailing list