https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118003

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2024-12-12
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
I used
/tmp/file-system-test-ed4fa1/DirNameWith19Chars1/DirNameWith19Chars2/DirNameWith19Chars3/DirNameWith19Chars4/DirNameWith19Chars5/DirNameWith19Chars6/DirNameWith19Chars7/DirNameWith19Chars8/DirNameWith19Chars9/DirNameWith19CharsA/DirNameWith19CharsB/DirNameWith19CharsC/
because with unique names it's easier to see how far down you are.

It doesn't hang for me under Wine, it just fails to remove the directory and
reports a "No such file or directory" error.

That happens in _Dir_base::advance:

  const posix::dirent*
  advance(bool skip_permission_denied, error_code& ec) noexcept
  {
    ec.clear();

    int err = std::exchange(errno, 0);
    const posix::dirent* entp = posix::readdir(dirp);

This readdir call (which uses _wreaddir) fails and sets errno. That's odd
because dirp was opened successfully by opendir. It's probably because we've
exceeded MAX_PATH at this point.

I don't have any good ideas for solving this. I don't really want to chdir into
each sub-directory so that opening the next one can use a relative path (and I
don't even know if that would work any differently).

I also don't want to have to use Windows APIs here.

Reply via email to