Changeset 932


Ignore:
Timestamp:
Aug 2, 2011, 3:03:13 AM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

QFile: Fixed open() docs.

The comment "Sequential devices, such as stdin and stdout..." in
the Windows section is true only partly -- as long as these devices are
attached to the console which performs all kinds of CRLF normalization
on its own. If they are redirected to regular files, then this normalzation
is not done which leads to all kinds of weird behavior (duplicate CR
symbols on output, hangs due to atEnd() returning false on input).

The affected warning is also valid on OS/2 so it now mentions this.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/src/snippets/code/src_corelib_io_qfile.cpp

    r846 r932  
    7474CONFIG += console
    7575//! [4]
     76
     77
     78
     79
     80
     81
     82
     83
     84
     85
     86
     87
     88
     89
  • trunk/src/corelib/io/qfile.cpp

    r846 r932  
    10411041    \sa close(), {qmake Variable Reference#CONFIG}{qmake Variable Reference}
    10421042
    1043     \bold{Note for the Windows Platform}
     1043    \bold{Note for the Windows }
    10441044
    10451045    \a fh must be opened in binary mode (i.e., the mode string must contain
    10461046    'b', as in "rb" or "wb") when accessing files and other random-access
    10471047    devices. Qt will translate the end-of-line characters if you pass
    1048     QIODevice::Text to \a mode. Sequential devices, such as stdin and stdout,
    1049     are unaffected by this limitation.
     1048    QIODevice::Text to \a mode. Predefined console devices, such as stdin and
     1049    stdout, should be put to binary mode using \c _setmode() before passing them
     1050    to this method:
     1051
     1052    \snippet doc/src/snippets/code/src_corelib_io_qfile.cpp 5
    10501053
    10511054    You need to enable support for console applications in order to use the
     
    11141117
    11151118    \sa close()
     1119
     1120
     1121
     1122
     1123
     1124
     1125
     1126
     1127
     1128
    11161129*/
    11171130bool QFile::open(int fd, OpenMode mode)
Note: See TracChangeset for help on using the changeset viewer.