Function rust_htslib::htslib::hts_open [] [src]

pub unsafe extern "C" fn hts_open(
    fn_: *const c_char,
    mode: *const c_char
) -> *mut htsFile

@abstract Open a SAM/BAM/CRAM/VCF/BCF/etc file @param fn The file name or "-" for stdin/stdout @param mode Mode matching / [rwa][bceguxz0-9]* / @discussion With 'r' opens for reading; any further format mode letters are ignored as the format is detected by checking the first few bytes or BGZF blocks of the file. With 'w' or 'a' opens for writing or appending, with format specifier letters: b binary format (BAM, BCF, etc) rather than text (SAM, VCF, etc) c CRAM format g gzip compressed u uncompressed z bgzf compressed [0-9] zlib compression level and with non-format option letters (for any of 'r'/'w'/'a'): e close the file on exec(2) (opens with O_CLOEXEC, where supported) x create the file exclusively (opens with O_EXCL, where supported) Note that there is a distinction between 'u' and '0': the first yields plain uncompressed output whereas the latter outputs uncompressed data wrapped in the zlib format. @example [rw]b .. compressed BCF, BAM, FAI [rw]bu .. uncompressed BCF [rw]z .. compressed VCF [rw] .. uncompressed VCF