given that the chan `oc` is only used in last line, did you consider *replacing* this argument with the destination filename and letting `to_file` handle the opening/closing of the channel?