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

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3: Somewhat important
    • 6.8.0 FF
    • 5.13.0, 5.15.4, 6.4.0 Beta4
    • Core: I/O
    • None
    • Linux/X11
    • ba2f79459 (dev)

    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

        1. qtbug77039.zip
          1 kB
          Friedemann Kleint

        Issue Links

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

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes