pathdef, savepath, ocaverc and Matlab

Ben Abbott bpabbott at mac.com
Fri Jan 4 21:02:20 CST 2008


On Jan 5, 2008, at 4:23 AM, John W. Eaton wrote:

> On  4-Jan-2008, Ben Abbott wrote:
>
> | Regarding (3), to mock the operation of Matlab as closely as  
> possible,
> | it would be preferred that pathdef.m returns the path after startup/
> | octaverc has been run, but before ~/.octaverc (at least thats's the
> | way Matlab works on my Mac.
> |
> | However, there are some problems/features with that. When savepath.m
> | is executed, Matlab saves the path to the equivalent of startup/
> | octaverc. At least that is the default ... Since all users on my Mac
> | have *write* access to that file, I less than happy about Matlab's
> | default.
>
> Really?  I would have thought that the normal Unixy thing to do would
> have those files owned by some other user and not writeable by
> ordinary users.
>
> Apparently Matlab tries pretty hard to write to the system-wide file.
> Here is what I see on a copy of Matlab at UW:
>
>>> savepath
>  chmod: changing permissions of `/afs/engr.wisc.edu/apps/matlab- 
> r2007a/toolbox/local/pathdef.m': Read-only file system

Do I understand that write permissions is granted by using chmod each  
time savepath.m is run? I would have thought the permissions had been  
changed for that file during the installation process (when Matlab had  
admin access).

> I don't have a strong opiniont about whether we should copy this
> behavior or not, but it seems that on a reasonable system, ordinary
> users would not be able to write the system file anyway, so maybe it
> doesn't matter so much.
>
> My conclusion is that savepath is a stupid function and shouldn't be
> used, but if you want to provide it for users who expect Octave to be
> just like Matlab, then maybe it should be 100% bug for bug compatible.

Presently I use the savepath function in my scripts for my toolboxes.  
However, having one file specify the path needed by multiple users  
creates a lot of head-aches.

Personally, I find Octave's approach to a user centric savepath is  
more desireable, and since an individual user would not notice the  
difference between savepath.m wrting to ~/.octaverc or to <octave- 
version>/m/startup/octaverc I'm inclined to preserved the way Octave  
does things now.

So while Octave would do things a bit different that Matlab, I don't  
see it as a compatibility issue.

In any event, I'll put together the complete changelog and patch,  
submit it and give this some more thought.

Ben


More information about the Octave-maintainers mailing list