Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-74291

QTemporaryFile does not work for Windows network paths

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 5.12.1
    • Fix Version/s: None
    • Component/s: Core: I/O
    • Labels:
    • Environment:
      Windows 10, VC14
    • Platform/s:
      Windows

      Description

      When using a template with an absolute Windows network path the opening of the QTemporaryFile fails because the path is not detected as an absolute path:

      QString absName = "\\\\localhost\\C$\\tmp.XXXXXX";
      QTemporaryFile tmp(absName);
      if (tmp.open())
      {
         tmp.close();
      }
      else
      {
         qDebug() << tmp.errorString();
      }
      

      QFileSystemEntry::isRelative() does not consider UNC paths such that QFileSystemEngine::absoluteName() adds the current working directory to the already absolute path.
      Using '/' as file separator seems to work by mistake.

        Attachments

          Issue Links

          For Gerrit Dashboard: QTBUG-74291
          # Subject Branch Project Status CR V

            Activity

              People

              • Assignee:
                Eddy Edward Welbourne
                Reporter:
                elgerton Martin Elger
              • Votes:
                1 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Gerrit Reviews

                  There is 1 open Gerrit change