write

Function write 

Source
pub fn write(path: impl AsRef<Path>) -> Result<Box<dyn Write>>
Expand description

Open a possibly compressed file for writing.

The file is specified by the given path. The file is decompressed by an external compression tool determined by the file extension:

  • .gz uses gzip
  • .bzip2 uses bzip2
  • .xz and .lzma use xz
  • .zst use zstd
  • everything else open the file directly without compression.