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

QTemporaryFile is not working as per the documentation when file is not on a local disk

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.0.0 Beta 2
    • 4.4.3
    • Core: I/O
    • None
    • ef3a544436beaecb4d26349ce115be39b680ef6a

    Description

      As per the documentation QTemporaryFile::createLocalFile should copy the file on network path and put it in the local file and return a pointer to QTemporaryFile. But when the file is not on a local disk the function return NULL.

      Example code:

      #include <QApplication>
      #include <QTemporaryFile>

      int main( int argc, char** argv )
      {
      int ret = 0;
      QApplication app( argc, argv );
      QFile file1("\\\\Server1\\attri
      at_02.txt"); // change to point to a file that do exist, not local
      file1.open(QIODevice::ReadOnly);
      QTemporaryFile* file = QTemporaryFile::createLocalFile(file1);
      qDebug() << file->fileName();
      return app.exec();
      }

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            andysh Andy Shaw
            xcm Martin Petersson (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes