Changeset 932 for trunk/doc/src/snippets


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.

File:
1 edited

Legend:

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

    r846 r932  
    7474CONFIG += console
    7575//! [4]
     76
     77
     78//! [5]
     79#if defined(Q_OS_WIN) || defined(Q_OS_OS2)
     80#include <io.h>
     81#include <fcntl.h>
     82#endif
     83
     84#if defined(Q_OS_WIN)
     85    _setmode(_fileno(stdin), _O_BINARY);
     86#elif defined(Q_OS_OS2)
     87    setmode(fileno(stdin), O_BINARY);
     88#endif
     89//! [5]
Note: See TracChangeset for help on using the changeset viewer.