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

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

[Octave-bug-tracker] [bug #57776] "dir" fails on the root directory of W


From: Markus Mützel
Subject: [Octave-bug-tracker] [bug #57776] "dir" fails on the root directory of Windows UNC shares
Date: Sun, 9 Feb 2020 10:14:23 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:73.0) Gecko/20100101 Firefox/73.0

Follow-up Comment #3, bug #57776 (project octave):

@Philip: I think you have been on to something. This code snippet from
file_stat::update_internal (in file-stat.cc @ line 192) removes trailing
slashes on Windows unless "full_file_name" is a root (like "C:\"):

#if defined (__WIN32__)
          // Remove trailing slash.
          if (full_file_name.length () > 1
              && sys::file_ops::is_dir_sep (full_file_name.back ())
              && ! (full_file_name.length () == 3 && full_file_name[1] ==
':'))
            full_file_name.pop_back ();
#endif


Probably, this should also NOT remove the trailing slash if "full_file_name"
is a UNC root (like "\\SERVER\share\").

Sure enough, I see the following:

>> [st, err, msg] = lstat ('\\SERVER\share\')
st = [](0x0)
err = -1
msg = No such file or directory
>> [st, err, msg] = lstat ('\\SERVER\share\\')
st =

  scalar structure containing the fields:

    dev = 3
    ino = 0
    mode = 16895
    modestr = drwxrwxrwx
    nlink = 1
    uid = 0
    gid = 0
    rdev = 3
    size = 0
    atime = 3.1553e+08
    mtime = 3.1553e+08
    ctime = 3.1553e+08
    blksize = NaN
    blocks = NaN

err = 0
msg =


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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