comparison src/file-io.cc @ 7078:405cf85b435c

[project @ 2007-10-30 14:04:59 by jwe]
author jwe
date Tue, 30 Oct 2007 14:05:00 +0000
parents a1dbe9d80eee
children 81bed50b9feb
comparison
equal deleted inserted replaced
7077:525cd5f47ab6 7078:405cf85b435c
142 { 142 {
143 // Could probably be faster, but does it really matter? 143 // Could probably be faster, but does it really matter?
144 144
145 std::string mode = mode_arg; 145 std::string mode = mode_arg;
146 146
147 size_t pos = mode.find ('z'); 147 // 'W' and 'R' are accepted as 'w' and 'r', but we warn about
148 // them because Matlab says they perform "automatic flushing"
149 // but we don't know precisely what action that implies.
150
151 size_t pos = mode.find ('W');
152
153 if (pos != NPOS)
154 {
155 warning ("fopen: treating mode \"W\" as equivalent to \"w\"");
156 mode[pos] = 'w';
157 }
158
159 pos = mode.find ('R');
160
161 if (pos != NPOS)
162 {
163 warning ("fopen: treating mode \"R\" as equivalent to \"r\"");
164 mode[pos] = 'r';
165 }
166
167 pos = mode.find ('z');
148 168
149 if (pos != NPOS) 169 if (pos != NPOS)
150 { 170 {
151 #if defined (HAVE_ZLIB) 171 #if defined (HAVE_ZLIB)
152 mode.erase (pos, 1); 172 mode.erase (pos, 1);