[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #54489] exist and isdir should look for direct
[Octave-bug-tracker] [bug #54489] exist and isdir should look for directories on the load path
Fri, 10 Aug 2018 18:38:53 -0400 (EDT)
Mozilla/5.0 (X11; Linux x86_64; rv:61.0) Gecko/20100101 Firefox/61.0
Summary: exist and isdir should look for directories on the
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
Assigned to: None
Discussion Lock: Any
Operating System: Any
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.
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:
Message sent via Savannah
- [Octave-bug-tracker] [bug #54489] exist and isdir should look for directories on the load path,
Mike Miller <=