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

QDataStream/QTextStream should do error checking when writing

    XMLWordPrintable

Details

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

    Description

      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).

      Attachments

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

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes