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

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

[Octave-bug-tracker] [bug #59706] Avoid "canonicalize_file_name" on Wind


From: Rik
Subject: [Octave-bug-tracker] [bug #59706] Avoid "canonicalize_file_name" on Windows
Date: Mon, 4 Jan 2021 13:54:15 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.66 Safari/537.36

Follow-up Comment #33, bug #59706 (project octave):

Octave is required to check for private folders as they form part of the
namespace that is created by the loadpath.  However, there is probably a way
to be more efficient about it.

First, we shouldn't need to check for private directories every time.  The
existence, or non-existence, of a private directory should be cached.  I can't
tell from comment #32 whether Octave already does this, or only the first time
the path is built.

Second, we shouldn't need to form the combination "dirname" + "/private" and
call canonicalize_file_name on the result.  Presumably we already have
"dirname" in canonical form and so can just add "/private" using string
manipulation and call stat() to see if the resulting directory exists.

If we want to be fancy, when we detect a directory exists we need to populate
the cache with the m-files that it contains.  Since we are looping over the
contents of the directory at that point we could put in a little extra code to
see if a "private/" directory already exists.  That would avoid the call to
stat() above.

    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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