Changeset 932
- Timestamp:
- Aug 2, 2011, 3:03:13 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/src/snippets/code/src_corelib_io_qfile.cpp
r846 r932 74 74 CONFIG += console 75 75 //! [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] -
trunk/src/corelib/io/qfile.cpp
r846 r932 1041 1041 \sa close(), {qmake Variable Reference#CONFIG}{qmake Variable Reference} 1042 1042 1043 \bold{Note for the Windows Platform}1043 \bold{Note for the Windows and OS/2 Platforms} 1044 1044 1045 1045 \a fh must be opened in binary mode (i.e., the mode string must contain 1046 1046 'b', as in "rb" or "wb") when accessing files and other random-access 1047 1047 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 1050 1053 1051 1054 You need to enable support for console applications in order to use the … … 1114 1117 1115 1118 \sa close() 1119 1120 \bold{Note for the Windows and OS/2 Platforms} 1121 1122 \a fd must be opened in binary mode (i.e., the open flags must contain 1123 _O_BINARY) when accessing files and other random-access devices. Qt will 1124 translate the end-of-line characters if you pass QIODevice::Text to 1125 \a mode. Predefined console devices, such as stdin and stdout, should be put 1126 to binary mode using \c _setmode() before passing them to this method: 1127 1128 \snippet doc/src/snippets/code/src_corelib_io_qfile.cpp 5 1116 1129 */ 1117 1130 bool QFile::open(int fd, OpenMode mode)
Note:
See TracChangeset
for help on using the changeset viewer.