Saturday, 15 January 2011

Network drives on Octave

Developing a new course always brings some surprises. Mine last week was to discover (during the very first tutorial session!) that the execution path of Octave doesn't seem to get updated automatically for networked and mounted drives - at least not on Windows machines. This means that you create a new m-file, then try to run it, but receive an error message saying that the m-file doesn't exist. Type 'ls' and you see the m-file is there. Type

exist('filename.m','file')

and Octave tells you the file is there. But try to run it and it's not seen. Quite an annoying bug.

Solution #1: Quit and restart Octave. Not much of a solution - my students weren't impressed.

Solution #2: Remove current directory from path, then add it again. Not more impressive.

Solution #3: Type

path(path);

every time a new m-file is created to refresh the path. This is the only (semi) sensible solution I've found so far.

Is this a Windows bug or an Octave one? I'm inclined to blame Windows of course but who knows? I couldn't find much information about this bug. Seems like we may have to buy Matlab licenses after all...

No comments:

Post a Comment