| 337 | } |
| 338 | |
| 339 | std::istream *openFile(const std::string& path, bool asBinary) |
| 340 | { |
| 341 | if (isRemote(path)) |
| 342 | { |
| 343 | arbiter::Arbiter a; |
| 344 | if (!a.hasDriver(path)) |
| 345 | return nullptr; |
| 346 | try |
| 347 | { |
| 348 | return new ArbiterInStream(tempFilename(path), path, |
| 349 | asBinary ? ios::in | ios::binary : ios::in); |
| 350 | } |
| 351 | catch (arbiter::ArbiterError& e) |
| 352 | { |
| 353 | throw e; |
| 354 | } |
| 355 | } |
| 356 | return FileUtils::openFile(path, asBinary); |
| 357 | } |
| 358 | |
| 359 | /** |
| 360 | Close an output stream. |