[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #54489] exist and isdir should look for direct
From: |
Mike Miller |
Subject: |
[Octave-bug-tracker] [bug #54489] exist and isdir should look for directories on the load path |
Date: |
Fri, 10 Aug 2018 18:38:53 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:61.0) Gecko/20100101 Firefox/61.0 |
URL:
<http://savannah.gnu.org/bugs/?54489>
Summary: exist and isdir should look for directories on the
load path
Project: GNU Octave
Submitted by: mtmiller
Submitted on: Fri 10 Aug 2018 03:38:52 PM PDT
Category: Octave Function
Severity: 2 - Minor
Priority: 5 - Normal
Item Group: Matlab Compatibility
Status: Postponed
Assigned to: None
Originator Name:
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Release: dev
Operating System: Any
_______________________________________________________
Details:
The Matlab function 'exist' looks for function files or mex files on the
search path. If it is given an arbitrary file name, it also looks for that
file on the search path. The same is true of directory names.
mkdir /tmp/mydir
addpath /tmp
exist ('mydir') ## this should return 7
exist ('mydir', 'dir') ## same
And the 'isdir' function follows the same logic, so it makes sense to be
implemented using 'exist'. Fixing 'exist' will fix 'isdir', both should be
documented as such.
Since 'isdir' may find directories on the load path, the new function
'isfolder' (see bug #54456) should be preferred if the code expects to be
dealing only with relative or absolute directory names. I beleve 'isfolder'
should be added first, and existing code migrated to 'isfolder', before we
change the underlying behavior of 'isdir'.
We may also move 'isdir' to the scripts/legacy directory as part of this,
since it is "not recommended" by Matlab.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?54489>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #54489] exist and isdir should look for directories on the load path,
Mike Miller <=