octave-maintainers
[Top][All Lists]
Advanced

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

Proposal patch for copyfile.m for octave for windows


From: Tatsuro MATSUOKA
Subject: Proposal patch for copyfile.m for octave for windows
Date: Sat, 16 May 2009 14:51:58 +0900 (JST)

Hello

 subject:Proposal patch for copyfile.m for octave for windows

I am trying to install Octave-forge Packages by pkg install command.
The codes concerning pkg.m seems to be revised comprehevely. 
However I found a problem pkg install on octave for windows.

See the following

***********
octave:9> glob('C:\Programs\OctaveBuild\bin\octave*.*')
ans = {}(0x0)
octave:10> glob('C:/Programs/OctaveBuild/bin\octave*.*')
ans = {}(0x0)
octave:11> glob('C:/Programs/OctaveBuild/bin/octave*.*')
ans =

{
  [1,1] = C:/Programs/OctaveBuild/bin/octave-3.0.5.exe
  [2,1] = C:/Programs/OctaveBuild/bin/octave-bug-3.0.5
  [3,1] = C:/Programs/OctaveBuild/bin/octave-config-3.0.5
  [4,1] = C:/Programs/OctaveBuild/bin/octave.bat
  [5,1] = C:/Programs/OctaveBuild/bin/octave.exe
  [6,1] = C:/Programs/OctaveBuild/bin/octave.ico
}

octave:12> glob(strrep ('C:\Programs\OctaveBuild\bin\octave*.*', "\\", "/"))
ans =

{
  [1,1] = C:/Programs/OctaveBuild/bin/octave-3.0.5.exe
  [2,1] = C:/Programs/OctaveBuild/bin/octave-bug-3.0.5
  [3,1] = C:/Programs/OctaveBuild/bin/octave-config-3.0.5
  [4,1] = C:/Programs/OctaveBuild/bin/octave.bat
  [5,1] = C:/Programs/OctaveBuild/bin/octave.exe
  [6,1] = C:/Programs/OctaveBuild/bin/octave.ico
**************

The funtion glob() requires filesep() == '/' like the above.
So that the script file 'copyfile.m' does not work correct on octave on windows:

77:    ## Protect the file name(s).
78:    f1 = glob (f1);
79:    if (isempty (f1))
80:      error ("copyfile: no files to move");
81:    endif

Owing to filesep() being '\', the above code always gives 'copyfile: no files 
to move'.

Then I applied patch the end of the mail.

In my home, the network speed is too slow to access to connect to Mecurcial 
archives of 3.1 Branch.
So I cannot see how the corresponding part of copyfile.m in 3.1 Branch 
currently is described.
I only have the source at 2009-02-04 of 3.1 Branch in my portable HDD.
The file 'copyfile.m' at 2009-02-04 of 3.1 Branch is the same as that of 3.0.5.
Perhaps the patch I proposed patch can be applied to development branch source.

Regards

Tatsuro

#******Patch
--- a/scripts/miscellaneous/copyfile.m  2009-05-16 08:44:24 +0900
+++ b/scripts/miscellaneous/copyfile.m  2009-05-16 14:11:43 +0900
@@ -75,7 +75,7 @@
     endif
     
     ## Protect the file name(s).
-    f1 = glob (f1);
+    f1 = glob (strrep (f1, "\\", "/"));
     if (isempty (f1))
       error ("copyfile: no files to move");
     endif



--------------------------------------
Power up the Internet with Yahoo! Toolbar.
http://pr.mail.yahoo.co.jp/toolbar/


reply via email to

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