Manuel Ortega wrote:
> > > I frequently use vim to read the contents of .tgz files. This has > > > recently stopped working. It works fine with my old Vim 7.2.333 on > > > Ubuntu and 8.0.1567 on Cygwin, but my newer 8.1.332 on Ubuntu and > > > 8.1.347 on Fedora fail as follows. > > > > > > $ /usr/local/bin/vim -N -u NORC --cmd 'set > > rtp=/usr/local/share/vim/vim81' > > /usr/share/doc/texlive-doc/generic/pstricks/pst-user.tgz > > > > > > The resulting buffer contains this. > > > > > > " tar.vim version v29 > > > " Browsing tarfile > > /usr/share/doc/texlive-doc/generic/pstricks/pst-user.tgz > > > " Select a file with cursor and press ENTER > > > > > > bzip2: /usr/share/doc/texlive-doc/generic/pstricks/pst-user.tgz is > > not a bzip2 file. > > > tar: This does not look like a tar archive > > > tar: Exiting with failure status due to previous errors > > > > > > It doesn't matter what .tgz file I try to open, the failure is the > > > same. I chose the one above because it was convenient. > > > > I thought this work, but now that I double check it also doesn't work > > for me. I think best is to use the "file" command to check the actual > > compression type. > > > > I think it's a bad idea to use `file`, even if `file` is available on all > platforms (I don't know whether it is). > > This will make the opening of *all* compressed files slower while we wait > for a shellout. Plus the output of `file` varies with the system and the > age of the system. So do the available options passable to `file`. This > is more trouble than it's worth. Not really. Opening a tar file already involves several system calls. The "file" command is fast. Of course there is a little overhead, but it's very small compared to actually opening a larger tar file. Having to manually figure out the compression, renaming the file (and renaming it back later) is much greater burden. > Improperly-named archives are the vast minority, and it's not reasonable to > require Vim to sort through that crap at the expensive of slowing down the > vast majority of cases. > > If a file is wrongly-named, that's not Vim's problem. It's not Vim's > problem for the same reason that it's not Vim's problem if someone named an > MS-word file with the incorrect extension ".txt", and opening it in Vim > results in a buffer full of gibberish. The problem with tar files is that compression is very much desired, otherwise they are huge. And since different compression mechanisms have been created over the hears and there is no common way for naming the compressed tar archives, this is a real problem. I run into it about every month. I don't really care who's problem it is, we can solve it. -- How To Keep A Healthy Level Of Insanity: 8. Don't use any punctuation marks. /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org /// -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
