octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #62865] 'path' should return drive letter, not


From: Philip Nienhuis
Subject: [Octave-bug-tracker] [bug #62865] 'path' should return drive letter, not UNC path when 'addpath' was called with drive letter
Date: Fri, 5 Aug 2022 14:50:40 -0400 (EDT)

URL:
  <https://savannah.gnu.org/bugs/?62865>

                 Summary: 'path' should return drive letter, not UNC path when
'addpath' was called with drive letter
                 Project: GNU Octave
               Submitter: philipnienhuis
               Submitted: Fri 05 Aug 2022 08:50:39 PM CEST
                Category: Octave Function
                Severity: 2 - Minor
                Priority: 5 - Normal
              Item Group: Matlab Compatibility
                  Status: None
             Assigned to: None
         Originator Name: Philip Nienhuis
        Originator Email: 
             Open/Closed: Open
                 Release: dev
         Discussion Lock: Any
        Operating System: Microsoft Windows


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Fri 05 Aug 2022 08:50:39 PM CEST By: Philip Nienhuis <philipnienhuis>
(split off from bug #62847)

Since (IIRC) 7.x.x, network paths returned by the 'path' command are shown as
UNC paths, regardless of what kind of path was fed to the 'addpath' command.
That is caused by 'addpath's helper function 'canonicalize_file_name', which
cf. posix semantics should always return a UNC path.

OTOH Matlab at my work (we're still on r2014a due to the old graphics stuff,
and occasionally use r2018b) returns drive letter search paths for network
drives.

This is a call for restoring the old behavior of Octave and make it more
Matlab-compatible, for the following reasons:
* Drive letters are much more parsimonious, they're easier to understand than
UNC paths, esp. for the Matlab newbies
* Drive letters are more permanent than UNC paths. Servers can be swapped,
file trees transferred, but drive letters usually persist
* Matlab's path command returns drive letter paths if we feed it drive letter
paths tru 'addpath'
* (A variant of the previous) it is addpath that adds paths to the path,
canonicalize_file_name is just a helper routine. I'd like the result of
addpath to resemble as much as possible what I have fed it. For me that makes
it a lot easier to e.g., figure out which variant of our Matlab script
libraries is actually invoked.

I'd guess (just a hunch) that if canonicalize_file_name, called from addpath,
successfully finds a network drive when given a drive letter path, addpath can
conclude that the drive letter path was valid and can enter that to the search
path rather than the UNC path.
Of course what happens next is quite relevant. If the interpreter must
re-morph drive letter paths into UNC paths when searching each separate
function, quite a bit of overhead is introduced. As Markus mentioned over in
bug #62487, comment #35:
> (A first step would be to check why we are canonicalizing paths in the load
path currently. Maybe that is not necessary?)
Again, Matlab doesn't seem to have any issues with it.

I've entered 'Matlab Compatibility' for 'Item Group" but it can be perceived
as feature request just as well.







    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?62865>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]