octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: __octave_srcdir__


From: Ben Abbott
Subject: Re: __octave_srcdir__
Date: Fri, 17 May 2013 11:32:10 +0800

On May 17, 2013, at 11:13 AM, Leo Liu wrote:

> On 2013-05-17 10:15 +0800, Mike Miller wrote:
>> I think I understand what you're trying to accomplish, but how is this
>> proposed function __octave_srcdir__ that just sets a persistent
>> variable any different functionally from a simple environment
>> variable? I can already do this in my ~/.octaverc:
>> 
>>  putenv ("OCTAVE_SRCDIR", "/home/mike/src/octave/default");
> 
> envvar is global. Consider the case of running multiple builds: 3.7.x
> and 3.6.4.
> 
> Leo

It's only global if you place it in .octaverc.  If I run multiple instances of 
Octave, each has its own environment.  So, I can run my default branch and ...

        putenv ("OCTAVE_SRCDIR", "/home/mike/src/octave/default");

... and then when running my stable branch ...

        putenv ("OCTAVE_SRCDIR", "/home/mike/src/octave/stable");

If you prefer, you could also use setappdata/getappdata and store the src 
directory in an app property associated with root.

        setappdata (0, "__octave_srcdir__", srcdir)
        srcdir = getappdata (0, "__octave_srcdir__")

Ben




reply via email to

[Prev in Thread] Current Thread [Next in Thread]