Fs Api Documentation

Version: 1.5.0

me.raynes.fs.compression

Compression utilities.

bunzip2

(bunzip2 source)(bunzip2 source target)

Takes a path to a bzip2 file source and uncompresses it.

gunzip

(gunzip source)(gunzip source target)

Takes a path to a gzip file source and unzips it.

make-zip-stream

(make-zip-stream & filename-content-pairs)

Create zip file(s) stream. You must provide a vector of the following form:

[[filename1 content1][filename2 content2]...].

You can provide either strings or byte-arrays as content.

The piped streams are used to create content on the fly, which means this can be used to make compressed files without even writing them to disk.

make-zip-stream-from-files

(make-zip-stream-from-files fpaths)

Like make-zip-stream but takes a sequential of file paths and builds filename-content-pairs based on those

untar

(untar source)(untar source target)

Takes a tarfile source and untars it to target.

unxz

(unxz source)(unxz source target)

Takes a path to a xz file source and uncompresses it.

unzip

(unzip source)(unzip source target-dir)

Takes the path to a zipfile source and unzips it to target-dir.

zip

(zip filename & filename-content-pairs)

Create zip file(s) on the fly. You must provide a vector of the following form:

[[filename1 content1][filename2 content2]...].

You can provide either strings or byte-arrays as content.

zip-files

(zip-files filename fpaths)

Zip files provided in argument vector to a single zip. Converts the argument list:


into filename-content -pairs, using the original file's basename as the filename in zip`and slurping the content: