let in_channel_is_file ic =
  let fd = Unix.descr_of_in_channel ic in
  match (Unix.fstat fd).Unix.st_kind with
  | Unix.S_REG -> true
  | _ -> false