Currently, .tbz files are treated as .tar.bz2 archives, so bunzip2 is used to decompress them. However, with the growing popularity of bzip3, some .tbz files may be compressed using bzip3 instead.
By using the file header to distinguish between these two formats, we can make the handling of .tbz files better.
Here are some references on file format I found:
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Currently, .tbz files are treated as .tar.bz2 archives, so bunzip2 is used to decompress them. However, with the growing popularity of bzip3, some .tbz files may be compressed using bzip3 instead.
That doesn#t seem correct. tar.vim uses file to determine the subtype and file correctly recognizes bzip3 and bzip2 compressed archives so tar.vim will correctly use either bzip3 or bzip2 to decode that archive. See here
But I notice we introduce a syntax error when reading from tar files. I fixed that in 8ac975d
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Closed #16761 as completed.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Reopened #16761.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Maybe we can separate the tarfile =~# '\.\(bz2\|tbz\|tb2\)$' case into two cases. For example,
elseif tarfile =~# '\.\(bz2\|tb2\)$' exe "sil! r! bzip2 -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - " elseif tarfile =~# '\.tbz' " Read the first three characters of the file to determine whether it is " compressed by bzip2 or bzip3. " bzip2 files has header 'BZh', bzip3 files has header 'BZ3' let header = strpart(readfile(a:filename, 0, 1), 0, 3) if first_chars == 'BZh' exe "sil! r! bzip2 -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - " elseif first_chars == 'BZ3' exe "sil! r! bzip3 -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - "
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Closed #16761 as completed.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()