bugGNU Octave - Bugs: bug #58118, canonicalize_file_name does not...

 
 

bug #58118: canonicalize_file_name does not return empty for non-existent files

Submitter:  Philip Nienhuis <philipnienhuis>
Submitted:  Sun 05 Apr 2020 01:54:20 PM UTC
   
 
Category:  Octave Function Severity:  5 - Blocker
Priority:  7 - High Item Group:  Regression
Status:  Fixed Assigned to:  None
Originator Name:  Philip Nienhuis Open/Closed:  * Closed
Release:  * 6.0.90 Operating System:  * Microsoft Windows
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Thu 09 Apr 2020 04:20:00 PM UTC, comment #9: 

Thanks for confirming the fix.

I opened bug #58148 for the other issue with capitalization.

Markus Mützel <mmuetzel>
Group administrator
Thu 09 Apr 2020 03:25:35 PM UTC, comment #8: 

The original issue has been addressed.  The additional problem/issue about capitalization can be followed in a new bug report, if it is indeed an issue.

Marking as fixed and closing report.

Rik <rik5>
Group administrator
Thu 09 Apr 2020 02:55:42 PM UTC, comment #7: 

Thanks,
My use case (UNO spreadsheet I/O interface in io package) is working again.

@Markus:
What do you mean with "capitalization is not canonicalized"?

Philip Nienhuis <philipnienhuis>
Group Member
Wed 08 Apr 2020 01:00:28 AM UTC, comment #6: 

Marking as Ready for Test.

Rik <rik5>
Group administrator
Tue 07 Apr 2020 07:24:49 AM UTC, comment #5: 

I pushed this change on the stable branch to fix the original issue:
https://hg.savannah.gnu.org/hgweb/octave/rev/6ea1e96b69d4

I also noticed that the capitalization is not canonicalized for some files on some partitions (all NTFS). I'll have a look why this is and how this can be done more consistently, too.

Markus Mützel <mmuetzel>
Group administrator
Mon 06 Apr 2020 04:02:44 PM UTC, comment #4: 

Yes I can confirm nowit is a Windows-only bug.
When I entered the bug report yesterday I'd swear I could reproduce it on Linux, but when retrying today it's working there as expected.

Philip Nienhuis <philipnienhuis>
Group Member
Mon 06 Apr 2020 07:13:28 AM UTC, comment #3: 

Confirmed on a Windows build (7.0.0 in this case).
This is probably something I broke and is also present in Octave 6.
I'll have a look at it when I come around to it.

Marking as a blocker and increasing priority.

Markus Mützel <mmuetzel>
Group administrator
Mon 06 Apr 2020 03:36:39 AM UTC, comment #2: 

Confirm RiK's comment #1 for openSUSE 15.1, Octave 6.0.90 and 7.0.0 (hg id ):


>> __octave_config_info__ ("hg_id")
ans = ad33d23d264f

>> canonicalize_file_name ("B.m")
ans =


Kai Torben Ohlhus <siko1056>
Group Member
Sun 05 Apr 2020 10:06:01 PM UTC, comment #1: 

This works for me on Linux with both 6.0.90 and 7.0.0.

Do you want to change the Operating System to "Microsoft Windows"?

Rik <rik5>
Group administrator
Sun 05 Apr 2020 01:54:20 PM UTC, original submission:  

Title says it all IMO, but to make it extra clear:


>> help canonicalize_file_name
'canonicalize_file_name' is a built-in function from the file libinterp/corefcn/syscalls.cc

 -- [CNAME, STATUS, MSG] = canonicalize_file_name (FNAME)
     Return the canonical name of file FNAME.

     If the file does not exist the empty string ("") is returned.


In Octave 6.0.1 and 7.0.0, under Linux and Windows,

>> dir A.m
A.m
>> exist ('A.m', 'file')
ans = 2
>> canonicalize_file_name ('A.m')
ans = C:\tmp\A.m

>> dir B.m
warning: dir: nonexistent directory 'B.m'
warning: called from
    dir at line 193 column 5

>> exist ('B.m', 'file')
ans = 0
>> canonicalize_file_name ('B.m')
ans = B.m
>>


This is working fine in Octave-5.2.0 and all previous releases.

Slightly OT:
dir.m, which does accept file names as input, apparently assumes a nonexistent specified file to always be a directory, where it may better say something more neutral along the lines of "<specified file name>: nonexistent". But that's just a minor inconsistency.

Philip Nienhuis <philipnienhuis>
Group Member

 

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

Attach Files:
   
   
Comment:
   

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)
  • -email is unavailable- added by siko1056 (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by philipnienhuis (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 9 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-04-09 rik5 StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2020-04-08 rik5 StatusConfirmed Ready For Test
    2020-04-06 mtmiller Item GroupNone Regression
    2020-04-06 mmuetzel Severity3 - Normal 5 - Blocker
        Priority5 - Normal 7 - High
        StatusNone Confirmed
        Summarycanonicalize_file_name doesn't not return empty for non-existent files canonicalize_file_name does not return empty for non-existent files
    2020-04-06 siko1056 Operating SystemAny Microsoft Windows

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code