[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #58118] canonicalize_file_name doesn't not ret
From: |
Philip Nienhuis |
Subject: |
[Octave-bug-tracker] [bug #58118] canonicalize_file_name doesn't not return empty for non-existent files |
Date: |
Sun, 5 Apr 2020 09:54:22 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; rv:52.0) Gecko/20100101 Firefox/52.0 Lightning/5.8.1 |
URL:
<https://savannah.gnu.org/bugs/?58118>
Summary: canonicalize_file_name doesn't not return empty for
non-existent files
Project: GNU Octave
Submitted by: philipnienhuis
Submitted on: Sun 05 Apr 2020 03:54:20 PM CEST
Category: Octave Function
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: None
Status: None
Assigned to: None
Originator Name: Philip Nienhuis
Originator Email:
Open/Closed: Open
Release: 6.0.90
Discussion Lock: Any
Operating System: Any
_______________________________________________________
Details:
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.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?58118>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #58118] canonicalize_file_name doesn't not return empty for non-existent files,
Philip Nienhuis <=
- [Octave-bug-tracker] [bug #58118] canonicalize_file_name doesn't not return empty for non-existent files, Rik, 2020/04/05
- [Octave-bug-tracker] [bug #58118] canonicalize_file_name doesn't not return empty for non-existent files, Kai Torben Ohlhus, 2020/04/05
- [Octave-bug-tracker] [bug #58118] canonicalize_file_name does not return empty for non-existent files, Markus Mützel, 2020/04/06
- [Octave-bug-tracker] [bug #58118] canonicalize_file_name does not return empty for non-existent files, Philip Nienhuis, 2020/04/06
- [Octave-bug-tracker] [bug #58118] canonicalize_file_name does not return empty for non-existent files, Mike Miller, 2020/04/06
- [Octave-bug-tracker] [bug #58118] canonicalize_file_name does not return empty for non-existent files, Markus Mützel, 2020/04/07
- [Octave-bug-tracker] [bug #58118] canonicalize_file_name does not return empty for non-existent files, Rik, 2020/04/07
- [Octave-bug-tracker] [bug #58118] canonicalize_file_name does not return empty for non-existent files, Philip Nienhuis, 2020/04/09
- [Octave-bug-tracker] [bug #58118] canonicalize_file_name does not return empty for non-existent files, Rik, 2020/04/09
- [Octave-bug-tracker] [bug #58118] canonicalize_file_name does not return empty for non-existent files, Markus Mützel, 2020/04/09