- bp = bcf_open(argv[optind], "r");
- h = bcf_hdr_read(bp);
- if (vc.flag & VC_BCF) {
- bout = bcf_open("-", "w");
- bcf_hdr_write(bout, h);
- }
+ strcpy(moder, "r");
+ if (!(vc.flag & VC_VCFIN)) strcat(moder, "b");
+ strcpy(modew, "w");
+ if (vc.flag & VC_BCFOUT) strcat(modew, "b");
+ if (vc.flag & VC_UNCOMP) strcat(modew, "u");
+ bp = vcf_open(argv[optind], moder);
+ h = vcf_hdr_read(bp);
+ bout = vcf_open("-", modew);
+ vcf_hdr_write(bout, h);