delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/02/09/14:32:03

X-Spam-Check-By: sourceware.org
Message-ID: <017b01c62daf$7696d140$0201a8c0@homelarrie>
From: "Larrie Carr" <larrie AT telus DOT net>
To: <cygwin AT cygwin DOT com>
Subject: [octave ] LOADPATH recurses only one level of subdirectories
Date: Thu, 9 Feb 2006 11:31:45 -0800
MIME-Version: 1.0
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

>Your attachments don't seem to be available, so I am not able to see the
>structure of your test.

>However, a test of my own indicates the functionality does work.  What I do 
>is
>create a file called .octaverc in my own home directory, with the contents

>++++++++
>LOADPATH=[LOADPATH,':~/.octave//];
>++++++++

>I then add my own private octave functions to the directory tree under
>~/.octave.  I tested that adding a new m-file more than one level down does
>make it available when octave is restarted, forcing the path to be
>re-traversed.

>Please realize that normally the LOADPATH is only recursed once, at the 
>time
>octave is loaded.  If you put new functions out there, you need to force 
>octave
>to re-read the path.  There may be other ways to do it, but the easiest is 
>to
>exit and restart.

The problem is not that is is NOT recursing, it just that it seems to 
recurse only 1 level down.  And I've looked over at the bug lists at 
octave.org and at cygwin looking for something related.

If the loadpath contains the path /blah/A//, I would expect the tool to find 
a file (say test.m) located /blah/A/B/C/D/test.m.  It does not.

But if the loadpath contains the path /blah/A/B/C//, the tool does recurse 1 
level through directory D to find the file.  That includes all combinations 
of restarting and setting the path (LOAD_PATH and DEFAULT_LOADPATH) and path 
/blah/A/B//.  I believe this does not match the documentation and user 
experiences.

In short, octave-forge is non-functional as it uses multiple subdirectories.

I've been looking through the sources and nothing has sprung up.  Did find a 
cut-and-paste code error in oct_file_in_path() in utils.cc where the string 
length is not properly checked.  Look like a cut and paste from 
fcn_file_in_path().  But this is for a different group.

int len = name.length();

if( len > 0) {
   if (len >2 && name [ len-4] == '.' && name [len-3] == 'o'
      && name[len-2] == 'c' && name [len-1] =='t') 



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019