- auto context = _session._sr_session->context();
- auto output_format = context->output_formats()["srzip"];
- auto device = _session.get_device();
- _output = output_format->create_output(device,
- {{"filename",
- Glib::Variant<Glib::ustring>::create(_file_name)}});
+ const auto context = session_.device_manager().context();
+ auto device = session_.device()->device();
+
+ map<string, Glib::VariantBase> options = options_;
+
+ if (!output_format_->test_flag(OutputFlag::INTERNAL_IO_HANDLING))
+ output_stream_.open(file_name_, ios_base::binary |
+ ios_base::trunc | ios_base::out);
+
+ output_ = output_format_->create_output(file_name_, device, options);