help-octave
[Top][All Lists]
Advanced

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

Re: New Octave for Windows sourceforge release


From: Doug Stewart
Subject: Re: New Octave for Windows sourceforge release
Date: Wed, 29 Mar 2006 15:25:21 -0500
User-agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)

Andy Adler wrote:

On Wed, 29 Mar 2006, Bill Denney wrote:

This doesn't fix the problem I was thinking of.  The problem that I was
discussing is if you do that it's fine, but if you type

edit plot

at the octave prompt with an editor that is outside of the cygwin
environment (i.e. notepad from your example), it will try to edit an empty
file because the path it will be passed is

\usr\share\octave\2.1.73\plot\plot.m

while notepad can't find a file there, it can find the file it's looking
for at

c:\cygwin\usr\share\octave\2.1.73\plot\plot.m

(I didn't specifically check the path to plot, so the path may be wrong,
but the statement is generally true).

Essentially we would need to check if the editor is outside the cygwin
environment then we may need to mangle the path to show correctly for
being called from outside cygwin.

Bill I have all this working in my version.


The cygwin utility to do this is cygpath.exe

so you can do
   system('cygpath -msa /usr/share/octave/2.1.73/plot/plot.m')
to get
   c:/cygwin/usr/share/octave/2.1.73/plot/plot.m

There are different switches for different slashes. If cygpath
doesn't exist, then we can assume that we're not on a cygwin
system.
--
Andy Adler <address@hidden> 1(613)562-5800x6218



Too make a general version of edit.m that will work in windows and Linux
I  tried the following with success in windows:


 if (getenv("OS")(1:3)=="Win")
   persistent FUNCTION = struct ("EDITOR", [ EDITOR, " %s &" ],
"HOME", getenv("HOME") , ##[ getenv("HOME"), "/octave" ], changed byDoug "AUTHOR",getenv('USERNAME'), ## getpwuid(getuid).gecos, changed by Doug "EMAIL", "" , ## [], changed by Doug
                 "LICENSE",  "GPL")
 else

Linux code here
 end

This does find that the OS is Windows_NT even though I have XP.
I could do this for each location where they differ.

Is this the correct way to go
I will do the work I just want the results to be acceptable to all

What does getenv("OS") give as an answer on Linux machines??
I just have a windows system :-(

Doug Stewart




-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

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