Proving that Golang, as of Go1.5.1 does not maintain sparse files during file compression with compress/tar
.
Steps to reproduce:
During Vagrant Provision, Vagrant will perform the following steps:
Install Go1.5.1
Create a Sparse file on the Linux Filesystem by:
# truncate -s 512M sparse.img
# ls -lash sparse.img 0 -rw-r--r-- 1 root root 512M Nov 30 21:29 sparse.img
Run compress.go
, which uses archive/tar
to compress the sparse file both with and without the sparse type set in the archive header. This creates directories of non_sparse/
and sparse/
for non-sparse and sparse compression, named respectively.
Extract both of the archives created from compress.go
.
# tar -C non_sparse/ -xf non_sparse/non_sparse.tar # tar -C sparse/ -xf sparse/sparse.tar
# ls -lash non_sparse/sparse.img 512M -rw-r--r-- 1 root root 512M Nov 30 21:29 non_sparse/sparse.img # ls -lash sparse/sparse.img 513M -rw-r--r-- 1 root root 512M Nov 30 21:29 sparse/sparse.img
tar -Scf tar/sparse.tar sparse.img
tar -C tar/ -xf tar/sparse.tar
ls -lash tar/sparse.img 0 -rw-r--r-- 1 root root 512M Nov 30 21:29 tar/sparse.img
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4