bugGNU Octave - Bugs: bug #43926, test fullfile fails in MXE-Octave...

 
 

bug #43926: test fullfile fails in MXE-Octave ver. 4.1.0+

Submitter:  Avinoam Kalma <avinoam>
Submitted:  Sat 03 Jan 2015 08:24:36 PM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  philipnienhuis
Originator Name:  Avinoam Open/Closed:  * Closed
Release:  * dev Operating System:  * Microsoft Windows
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Sun 11 Jan 2015 09:01:16 PM UTC, comment #10: 


see bug 43979

Avinoam Kalma <avinoam>
Group Member
Sun 11 Jan 2015 07:40:34 PM UTC, comment #9: 

@Avinoam:
Will you still file the bug report for unpack(), please?
Thanks

Philip Nienhuis <philipnienhuis>
Group Member
Sun 11 Jan 2015 07:32:50 PM UTC, comment #8: 

I've adapted the original cs to also properly process drive letters on Windows + added two tests for that.

Pushed:
http://hg.savannah.gnu.org/hgweb/octave/rev/c304687571c8

closing report

Philip Nienhuis <philipnienhuis>
Group Member
Thu 08 Jan 2015 11:25:14 PM UTC, comment #7: 

Yes, Matlab doesn't recognize "/" (slash) as path separator; although it changes it into a backslash. But doesn't collapse multiple consecutive backslashes into a single one.
Hmm.... looks like a ML bug...

Coming weekend I'll look again at his bug/patch


Philip Nienhuis <philipnienhuis>
Group Member
Wed 07 Jan 2015 10:06:56 PM UTC, comment #6: 

Hi,

checking matlab compatability in MATLAB Version 7.10.0.499 (R2010a)
under windows:

fullfile ('a/', '/', '/', 'b', '/', '/')

ans =

a\\\b\\

 Octave result is different.

Avinoam Kalma <avinoam>
Group Member
Mon 05 Jan 2015 12:29:06 PM UTC, comment #5: 

Thanks for testing.
It occurred to me that perhaps the patch needs a bit more polishing as Windows has drive letters and *nix has not. I'll look into that (= whether it's needed) later on.

As to unpack, yes I just tried but what I saw has nothing to do with file separators but with tmp file/dir stuff.
Anyway please file a bug report for the error you saw.

Philip Nienhuis <philipnienhuis>
Group Member
Sun 04 Jan 2015 08:39:02 PM UTC, comment #4: 


Hi,

Thanks, it solves the bug.

Avinoam

P.S.
test unpack fails from the same reason ('/' and '\' are not
the same). Should I open another bug?

Avinoam Kalma <avinoam>
Group Member
Sun 04 Jan 2015 01:46:35 PM UTC, comment #3: 

Here's a fix that works on Windows.

I saw little other options than to change '/' file separators on Windows (that do work generally) into native file separators ('\').
I also thought about mentioning that in the texinfo header but couldn't come up with good wording. Anyone?


(file #32755)

Philip Nienhuis <philipnienhuis>
Group Member
Sun 04 Jan 2015 12:27:41 PM UTC, comment #2: 

Took a brief look in the fullfile.m function. Some comments:

1. In 4.1.0+ there's a completely new fullfile.m version compared to 3.9.0+.

2. (Just a hunch) maybe the various "/" entries in the last tests had better be replaced by filesep characters (variable 'fs') to match the system's native file separator character ? 
...but then again....:

3. On Windows, where filesep equals "\" (backslash), Octave very very often works equally well with "/" (forward slash) file separators. In fact I rarely use backslashes when doing file handling stuff with Octave on Windows.
Moreover, several Java functions when called through the Java interface simply do not accept backslashes as file separators, they want forward slashes, whether on Windows or not.

So relying on the system's filesep may need a little more rigid investigation.

Philip Nienhuis <philipnienhuis>
Group Member
Sun 04 Jan 2015 11:26:15 AM UTC, comment #1: 

Confirmed.
It works fine in 3.9.0+

Philip Nienhuis <philipnienhuis>
Group Member
Sat 03 Jan 2015 08:24:36 PM UTC, original submission:  


Hi,

using GNU Octave Version: 4.1.0+ on Windows-7, (mxe-octave)
fullfile test fails in 4 of 24 tests. For example:


>> test fullfile
***** assert (fullfile ("a/", "/", "/", "b", "/", "/"), "a/b/")
!!!!! test failed
ASSERT errors for:  assert (fullfile ("a/", "/", "/", "b", "/", "/"),"a/b/")

  Location  |  Observed  |  Expected  |  Reason
     []      a/\/\/\b\/\/     a/b/       Strings don't match
shared variables   scalar structure containing the fields:
    fs = \
    fsx = \x
    xfs = x\
    fsxfs = \x\
    xfsy = x\y


Thanks.

Avinoam

Avinoam Kalma <avinoam>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #32755:  bug43926_try1.cs added by philipnienhuis (2KiB - text/x-csharp)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by avinoam (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-01-11 philipnienhuis StatusPatch Submitted Fixed
        Open/ClosedOpen Closed
    2015-01-10 philipnienhuis Assigned toNone philipnienhuis
    2015-01-04 philipnienhuis StatusNone Patch Submitted
    2015-01-04 philipnienhuis Attached File- Added bug43926_try1.cs, #32755

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code