jmbarbone / mark

R package with a set of general use functions for easier working
https://jmbarbone.github.io/mark/
Other
6 stars 1 forks source link

add compression options for `write_file_md5()` #224

Closed jmbarbone closed 12 months ago

jmbarbone commented 1 year ago

can take some inspiration from readr::write_rds():

compress <- match.arg(compress, c("none", "gz", "bz", "xz"))
con <- switch(
  compress,
  none = file(file, ...),
  gz = gzfile(file, ...),
  bz = bzfile(file, ...),
  xz = xzfile(file, ...)
)

write_function(x, con, ...)

all functions need to be rewritten to accept connections and set encoding via that function instead.