Compression

Fred Bone Fred.Bone at dial.pipex.com
Sun Feb 12 06:19:36 EST 2012


On 11 February 2012 at 12:15, Derek Atkins said:

> "Dustin Henning" <The00Dustin at gmx.net> writes:
> 
> > For the record, 7zip has a gzip option (along with several others), this
> > is the option I used.  Maybe the file is tarballed before it is 
> > gzipped? Otherwise the specific settings matter.  Regardless, it
> > occurred to me after I sent the e-mail that I could open, save, and
> > delete the uncompressed copy.
> 
> I don't know what 7zip does.  It is possible that it uses some container
> inside the gzip, which would cause GnuCash to barf.  The easiest thing to
> do is, again, just have GnuCash open the uncompressed file, and then when
> it writes back out it'll compress it again for you.  You do not need to
> re-compress the file yourself; GnuCash can read uncompressed data even if
> the preference for compression is on.

One small data point FWIW: I took an old Gnucash uncompressed file (not 
sure which GNucash version) and compressed it in GZip format using 7-Zip. 
Gnucash declined to open it saying "This file/URL appears to be from a 
newer version of GnuCash. You must upgrade your version of GnuCash to 
work with this data." It is quite happy to open the uncompressed file, 
even though it's three years old, so I deduce that it's something about 
the compression that's the problem. However, if I extract the file it is 
identical to the original.

The .gz file created by 7-Zip is (AFAICT) only gzipped, not otherwise 
modified or containerized. I tried asking for "fastest" (vs "normal") 
compression with a reduced dictionary wordsize (12 instead of 32) but 
that made no difference as far as Gnucash was concerned.

I have in the past successfully used a GZip-aware editor, JEdit, to 
modify a compressed Gnucash file. So I tried opening my test file in that 
and saving in .gz format. Same result. However, opening a compressed 
file, modifying it, and re-saving produced a file Gnucash was happy to 
open.

(Windows XP-SP2; 7-Zip 4.65)



More information about the gnucash-user mailing list