Sunday, June 3, 2018

Re: compressed undofiles

On 03.06.18 09:46, Bram Moolenaar wrote:
>
> Adam Monsen wrote:
>
> > I use undofiles heavily. I often copy a file along with its undofile when
> > creating a new similar file. I notice (a) the undofiles can get quite large
> > and (b) they compress very efficiently. I tested compressing a few
> > ".test.txt.un~" files with gzip and saw 90% compression.
> >
> > Anyone interested in compressed undofiles?
>
> That sounds like a useful option. It could be implemented like a
> filter, using gzip to read from stdin or write to stdout.
>
> The largest proglem I see is to detect that an undo file is compressed,
> know that the filter needs to be used. Perhaps we could read some
> number of bytes from the file and match a regexp on it?

If compression produces a binary file, i.e. contains bytes not found in
the character sets used by Vim, then that ought to be definitive, I
figure. If not, some "magic" could perhaps be prefixed, and removed on
decompression.

In any event, the distinguishing test ought to be replicable by the
"file" command. So, if "file" can already identify e.g. an lz4 file,
then its test would seem to suffice.

Erik

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: