- std::ostream *ostream = check_ostream(opt, opt.argof("file"), fstream);
-
- auto file = opt.argof("file");
- if (file && *file) {
- fstream.open(file, std::ios::binary | std::ios::out);
- if (!fstream.is_open()) {
- exit_code = EXIT_FAILURE;
- if (!opt.isset("quiet")) {
- std::cerr << "Failed to open " << file << " for writing.\n";
- }
- continue;
- }
- ostream = &fstream;
- }