bugGNU Octave - Bugs: bug #55824, function EXIST returns wrong...


bug #55824: function EXIST returns wrong result for a network drive

Submitted by:  None
Submitted on:  Mon 04 Mar 2019 10:37:30 AM UTC  
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  Closed Release:  5.1.0
Operating System:  Microsoft Windows

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Fri 08 Mar 2019 09:20:33 PM UTC, comment #4: 

I can see the following on Windows with the default branch now:

>> exist ('c:')
ans =  7
>> exist ('c:\')
ans =  7
>> exist ('s:')
ans = 0
>> exist ('\\ASUS-UX510UX\share')
ans =  7
>> exist ('\\ASUS-UX510UX\share\')
ans =  7
>> exist ('\\ASUS-UX510UX\shar')
ans = 0

I think this is what we expect.

Thanks Philip for running the tests in Matlab.

Closing as fixed.

Markus Mützel <mmuetzel>
Project Member
Tue 05 Mar 2019 09:27:03 PM UTC, comment #3: 

I pushed a patch here that should fix "exist" for drive letters and UNC shares:

Marking as ready for test.

Markus Mützel <mmuetzel>
Project Member
Mon 04 Mar 2019 09:52:29 PM UTC, comment #2: 

Matlab r2019a:

>> format compact
>> exist ('M:\MP3\Outlook_for_Thursday_1.zip')
ans =
>> exist ('\\nsa310\music')
ans =
>> exist ('\\nsa310\music', 'dir')
ans =
>> exist ('\\nsa310\music\MP3\Outlook_for_Thursday_1.zip', 'dir')
ans =
>> exist ('\\nsa310\music\MP3\Outlook_for_Thursday_1.zip', 'file')
ans =
>> exist ('C:')
ans =
>> ver
MATLAB Version: (R2019a) Prerelease

where M: is mapped to \\nsa\music.

And in Matlab "exist ('C:')" gives 7, not 0 as in Octave.

Philip Nienhuis <philipnienhuis>
Project Member
Mon 04 Mar 2019 08:04:06 PM UTC, comment #1: 

That might be something that has changed since I added support for accessing folders with non-ASCII characters.

Underlying "exist" uses "stat". That doesn't work on a share. But it does on folders or files in that share. So something like this should still work:

exist ('\\serverX\shareY\folderZ', 'dir')
exist ('\\serverX\shareY\some_file.tst', 'file')

Since "\\serverX\shareY" is somewhat like a drive letter and exist('C:') returns 0 as well, I am not sure what the expected behaviour is.
What does Matlab return for these cases?

Markus Mützel <mmuetzel>
Project Member
Mon 04 Mar 2019 10:37:30 AM UTC, original submission:  

exist('\\serverX\dirY', 'dir') returns 0 in release 5.1.0, while in release 4.4.1 the same command returns the correct result (= 7).

Similarly, in release 5.1.0, the command dir('\\serverX\dirY') throws an error ("... non-existing directory ..."), while in  4.4.1 the same command returns the correct directory listing.

The network path name is correct - when I paste '\\serverX\dirY' into windows explorer I do get to the correct (existing) network location.

My operating system is windows 10 v.1809 pro 64 bit. Installed Octave is also 64 bit.

More functions could be impacted, like fileread:
in 4.4.1, x=fileread('\\serverX\dirY\fileZ.txt') works correctly.
I didn't test it in 5.1.0 before uninstalling it, but maybe the result is also wrong...



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

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by mmuetzel (Posted a comment)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.




    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-03-08 mmuetzel StatusReady For Test => Fixed
        Open/ClosedOpen => Closed
    2019-03-05 mmuetzel StatusNone => Ready For Test

    Back to the top

    Powered by Savane 3.5