[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #36677] canonicalize_file_name: inconsistent b
From: |
Philip Nienhuis |
Subject: |
[Octave-bug-tracker] [bug #36677] canonicalize_file_name: inconsistent behavior for non-existing files |
Date: |
Fri, 29 Jun 2012 21:19:39 +0000 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.11) Gecko/20100701 SeaMonkey/2.0.6 |
Follow-up Comment #2, bug #36677 (project octave):
Thanks Rik.
Well, it works to some extent, but now I get other bugs (specific for
Windows).
See below for a CLI session, sorry *nix users for the Windows-specific
idiosyncrasies:
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
rem ========== go to Octave bin dir ===============
C:\Home\Philip>cd c:\programs\octave\octave-3.6.2\bin
rem ========== set a working dir on drive F: ======
C:\Programs\Octave\Octave-3.6.2\bin>cd f:\svn\octave.sf.net\extra\java
C:\Programs\Octave\Octave-3.6.2\bin>dir f:
Volume in drive F is BIGWIN1
Volume Serial Number is 746C-E43B
Directory of F:\svn\octave.sf.net\extra\java
28-Apr-12 19:50 <DIR> .
28-Apr-12 19:50 <DIR> ..
28-Apr-12 19:51 <DIR> doc
28-Apr-12 19:52 75 configure
28-Apr-12 19:52 369 DESCRIPTION
28-Apr-12 19:52 110 PKG_DEL
28-Apr-12 19:52 <DIR> src
28-Apr-12 19:52 372 INDEX
28-Apr-12 19:52 <DIR> inst
28-Apr-12 19:52 17 983 COPYING
28-Apr-12 19:52 1 092 PKG_ADD
28-Apr-12 19:52 4 035 Makefile
29-Jun-12 19:05 3 226 preinstall.m
8 File(s) 27 262 bytes
5 Dir(s) 823 967 744 bytes free
rem ========== OK, now starting Octave ===========
C:\Programs\Octave\Octave-3.6.2\bin>octave
GNU Octave, version 3.6.2
<snip>
Octave was configured for "i686-pc-mingw32".
<snip>
octave:1> pwd
ans = c:\home\philip\mydocs\octave
octave:2> filename = 'notfound.fil'
filename = notfound.fil
octave:3> make_absolute_filename (filename)
ans = c:\home\philip\mydocs\octave\notfound.fil
# Correct
octave:4> filename = '..\notfound.fil'
filename = ..\notfound.fil
octave:5> make_absolute_filename (filename)
ans = c:\home\philip\mydocs\notfound.fil
# Correct
octave:6> filename = 'f:PKG_ADD'
filename = f:PKG_ADD
octave:7> make_absolute_filename (filename)
ans = c:\home\philip\mydocs\octave\f:PKG_ADD
# Wrong
octave:8> canonicalize_file_name (filename)
ans = F:\svn\octave.sf.net\extra\java\PKG_ADD
# Correct
(Probably unneeded explanation for Windows haters:)
On windows you have a current directory on every drive (-letter). So while
you're on drive C:, accessing a file on another drive depends on that other
drive's current dir.
That's where make_absolute_filename() fails, but canonicalize_file_name()
works correctly.
So yes, in principle if on *nix I could use make_absolute_filename() and on
Windows canonicalize_file_name()
But, could canonicalize_file_name() be made to fall back on
make_absolute_filename() on *nix, and vice versa on Windows?
That would be a "better" solution, not so much because I wouldn't have to fix
the io pkg scripts then, but rather because the two functions would work
consistently (cross-platform) in core Octave.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?36677>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/