Last active
May 8, 2022 03:04
-
-
Save fukamachi/6364983 to your computer and use it in GitHub Desktop.
A Common Lisp function to extract a tarball (.tar.gz) file to a directory (*default-pathname-defaults*).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ql:quickload '(chipz archive)) | |
(defun extract-tarball (pathname) | |
"Extract a tarball (.tar.gz) file to a directory (*default-pathname-defaults*)." | |
(with-open-file (tarball-stream pathname | |
:direction :input | |
:element-type '(unsigned-byte 8)) | |
(archive::extract-files-from-archive | |
(archive:open-archive 'archive:tar-archive | |
(chipz:make-decompressing-stream 'chipz:gzip tarball-stream) | |
:direction :input)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment