Extracting tar files
This blog will explain you how to extract the tar file using go.
Tar files contain the header which we need to understand to extract the content of the tar file. For much details follow the blog from @vladimirvivien.
Extracting a tar file is three step process :
- Read the file as
io.Reader
. - Create
gzip.Reader
fromio.Reader
. - Create
tar.Reader
fromgzip.Reader
. - Use this new reader to process the zipped file iteratively.
Written on August 6, 2022