mafintosh / tar-stream

tar-stream is a streaming tar parser and generator.
MIT License
406 stars 92 forks source link

All file attributes included in pax header #112

Closed whikloj closed 1 year ago

whikloj commented 4 years ago

This might be a problem or maybe my lack of understanding, but it appears that instead of encoding just the extended file attributes in the pax extended header (typeflag=x || typeflag=g), all of the information of the file is included in that block. So when I take a TAR that is generated with tar-stream and try to un-tar it with a library that does not support pax extended headers (PEAR's Archive_Tar for example) I end up with only directories and no files extracted.

Again, this might be an lack of understanding on my part.

Using OSX

> tar --version
bsdtar 2.8.3 - libarchive 2.8.3

> ls -l normal/Test
total 40
-rw-r--r--  1 whikloj  staff   73 27 Feb 17:52 aptrust-info.txt
-rw-r--r--  1 whikloj  staff  326 27 Feb 17:52 bag-info.txt
-rw-r--r--  1 whikloj  staff   55 27 Feb 17:52 bagit.txt
drwxr-xr-x  3 whikloj  staff   96 27 Feb 17:52 data
-rw-r--r--  1 whikloj  staff   47 27 Feb 17:52 manifest-md5.txt
-rw-r--r--  1 whikloj  staff  317 27 Feb 17:52 tagmanifest-sha256.txt

Using Archive_Tar

> ls -l archive_tar/Test     
total 0
drwxr-xr-x  2 whikloj  staff  64 27 Feb 17:55 data

> ls -l archive_tar
total 8
-rw-r--r--  1 whikloj  staff  317 27 Feb 17:52 PaxHeader
drwxr-xr-x  3 whikloj  staff   96 27 Feb 17:55 Test

I said no files are extracted, this is not actually true because the PaxHeader file contains the last file extracted (as I am assuming it keeps overwriting because they all have the same filename).

I'm relatively new to this but does your utility follow the pax headers with standard ustar headers?

mafintosh commented 1 year ago

we follow pax ya in later versions