Allows the compression and uncompression of files
Details
Functions are
gunzip_file
: uncompresses a gz-archive to raw binary data
-gzip_file
: compresses a raw binary data file to a gz-archive
Examples
gzfile <- system.file("extdata", "ex20101224.TEST_ITCH_50.gz", package = "RITCH")
file <- system.file("extdata", "ex20101224.TEST_ITCH_50", package = "RITCH")
# uncompress file
(outfile <- gunzip_file(gzfile, "tmp"))
#> [1] "tmp"
file.info(outfile)
#> size isdir mode mtime ctime
#> tmp 465048 FALSE 644 2024-08-25 09:56:42 2024-08-25 09:56:42
#> atime uid gid uname grname
#> tmp 2024-08-25 09:56:42 1001 127 runner docker
unlink(outfile)
# compress file
(outfile <- gzip_file(file))
#> [1] "ex20101224.TEST_ITCH_50.gz"
file.info(outfile)
#> size isdir mode mtime
#> ex20101224.TEST_ITCH_50.gz 159965 FALSE 644 2024-08-25 09:56:42
#> ctime atime uid gid
#> ex20101224.TEST_ITCH_50.gz 2024-08-25 09:56:42 2024-08-25 09:56:42 1001 127
#> uname grname
#> ex20101224.TEST_ITCH_50.gz runner docker
unlink(outfile)