Function anycat::readfile [] [src]

pub fn readfile(fname: &str) -> Box<BufRead>

Returns a BufRead to the file denoted by the given fname. The stream is possibly decompressed using the following scheme. Depending on the file extension, the following algorithm is used: - .gz, .gzip ===> GZIP - .z , .zlib ===> ZLIB - .dfl ===> DEFLATE - .bz2, .bzip ===> BZ2 - .xz2, .lzma ===> LZMA (xz2) - .br , .brotli => BROTLI

Otherwise, the file is assumed to contain plaintext and is treated as such