On Fri, Sep 7, 2018 at 4:23 PM Bram Moolenaar <[email protected]> wrote:

>
> Gary Johnson 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.

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.

-Manny

-- 
-- 
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.

Raspunde prin e-mail lui