windows native Octave-2.9.9+ does not read ./.octaverc at startup

Kenneth Cate PathFinder_Cate at Yahoo.com
Thu Jun 19 11:23:36 CDT 2008



Benjamin Lindner wrote:
> 
> Hi list,
> 
> I have installed michael's Octave 2.9.9+ windows binary from 
> http://www.dbateman.org/?page=octave&lang=EN and found, that at 
> startup octave does not load a .octaverc file in the current directory.
> The startup file in the home directory and the system-wide startup files
> are loaded.
> I do not see this behaviour with version 2.9.9 under linux&cygwin and 
> neither with 2.9.10 under cygwin, so i guess this is a bug in the windows
> port?
> 
> I am testing this on a P4 w2k sp4 machine.
> 
> regards
> benjamin
> _______________________________________________
> Bug-octave mailing list
> Bug-octave at octave.org
> https://www.cae.wisc.edu/mailman/listinfo/bug-octave
> 
> 

A possible way to get around the problem in Windows is to patch the script
"c:\Program Files\Octave\share\octave\version\m\startup\octaverc".
I added to my copy of octaverc the following:

# Execute the current User's startup.m and .octaverc on a Windows System
# ( Added by Kenneth H. Cate on 2008-06-19 )
#
users_path = getenv("USERPROFILE");
if ~isempty(users_path)
  users_path = [users_path, filesep];

  # Windows:
  p1 = [users_path, "Application Data", filesep, "octave"];     # Some users
might prefer this path
  p2 = [p1, filesep];
  if     (exist ([p2, "startup.m"], "file")), addpath (p1, "-end");
  elseif (exist ([p2, ".octaverc"], "file")), addpath (p1, "-end"); end

  # Windows Vista:
  p1 = [users_path, "AppData", filesep, "Roaming", filesep, "octave"];
  p2 = [p1, filesep];
  if     (exist ([p2, "startup.m"], "file")), addpath (p1, "-end");
  elseif (exist ([p2, ".octaverc"], "file")), addpath (p1, "-end"); end

  p1 = [users_path, "octave"];
  p2 = [p1, filesep];
  if     (exist ([p2, "startup.m"], "file")); addpath (p1, "-end");
  elseif (exist ([p2, ".octaverc"], "file")), addpath (p1, "-end"); end
  if (exist ("startup.m", "file"))
    startup
  end
  clear p1 p2
end
clear users_path

This goes ahead of the final fprintf ("\n")
This allows Octave to find the startup.m or .octaverc scripts for the
current user.


-- 
View this message in context: http://www.nabble.com/windows-native-Octave-2.9.9%2B-does-not-read-.-.octaverc-at-startup-tp9953512p18012770.html
Sent from the Octave - Bugs mailing list archive at Nabble.com.



More information about the Bug-octave mailing list