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: Markus Mützel
Subject: [Octave-bug-tracker] [bug #62865] 'path' should return drive letter, not UNC path when 'addpath' was called with drive letter
Date: Fri, 12 Aug 2022 03:21:57 -0400 (EDT)

Follow-up Comment #15, bug #62865 (project octave):

> Does your CMD.exe support UNC paths?

It doesn't. (But I'm not sure why `cmd.exe` should be involved when adding a
directory to the load path...)

> the part about just one unique name for a path entry. But he didn't motivate
why that should be the actual name of the directory rather than symlinks.

IIUC, the load path needs to fulfill two conditions (currently):
1. Check if a certain file is in some folder in the load path.
2. Determine in which directory in the load path a given file resides.

The first condition is pretty easy to realize. (Famous last words. 😉)

The second one is much harder:
It is rather simple to get the "actual" path (One True Directory, i.e.,
"canonicalized path") for a path of a pretty much arbitrary form. But it is
virtually impossible to calculate the whole set of possible paths that could
point to a given file. (Those could be infinitely many.) And then compare all
of those to the path stored in the load path to check where it matches.
This is further complicated by the fact that file paths are case-insensitive
most of the time on Windows (but sometimes they aren't).
The only reasonable way to know if two paths are actually the same (without
accessing files repeatedly, and that should be working independent of the used
file system) is to canonicalize them and compare those canonicalized paths.
That is what is currently done in the load path afaict.


    _______________________________________________________

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]