| 189 | |
| 190 | |
| 191 | std::ostream *openExisting(const std::string& name, bool asBinary) |
| 192 | { |
| 193 | std::ios::openmode mode = std::ios::out | std::ios::in; |
| 194 | if (asBinary) |
| 195 | mode |= std::ios::binary; |
| 196 | |
| 197 | VSI::VSIOStream *ofs = new Utils::ClassicLocaleStream<VSI::VSIOStream>(name, mode); |
| 198 | if (!ofs->good()) |
| 199 | { |
| 200 | delete ofs; |
| 201 | return nullptr; |
| 202 | } |
| 203 | return ofs; |
| 204 | } |
| 205 | |
| 206 | |
| 207 | bool directoryExists(const std::string& dirname) |