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

QSaveFile::size() reports 0 after writing a file

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.13.0, 5.15.4, 6.4.0 Beta4
    • Core: I/O
    • None
    • Linux/X11

    Description

      When porting from QFile:

           QSaveFile sf(path);
              if (sf.open(QIODevice::WriteOnly)) {
                  sf.write("Hello\n");
                  ok = sf.commit();
                  if (ok)
                      qDebug() << "Wrote " << sf.size() << " bytes to " << path;
              }
      

      prints

      Wrote  0  bytes to  "/tmp/test.txt"
      Empty filename passed to function
      

      Attachments

        Issue Links

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

          Activity

            People

              dfaure_kdab David Faure
              kleint Friedemann Kleint
              Vladimir Minenko Vladimir Minenko
              Alex Blasche Alex Blasche
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There is 1 open Gerrit change