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

QDataStream/QTextStream should do error checking when writing

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3: Somewhat important P3: Somewhat important
    • Some future release
    • 4.4.3
    • Core: I/O
    • None

      QDataStream has code like
      dev->write(b, 2);
      which doesn't check that the write was successful.
      If the disk is full, then the above might not write 2 bytes, but 0 or 1.
      QDataStream needs error checking in order to be useful (in a robust manner).
      It would be as simple as:
      if (dev->write(b,2) < 2)
      q_status = CouldNotWrite;
      (which would be a new enum value for the Status enum).

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

            stormols Marius Storm-Olsen
            xcm Martin Petersson (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes