From: Giovanni C. <val...@li...> - 2001-02-06 17:22:53
|
On 06 Feb 2001 15:35:20 +0100, Hongli Lai wrote: > On Mon, 05 Feb 2001 23:05:47 Giovanni Corriga wrote: > > I have written support for .tar.gz files. It was really easy, I had only > > to switch from fopen() to gzopen() etc. > > Files are attached. > > Those files haven't been committed yet. > > I was thinking about tgz support. > And I think using your method (replacing fopen() to gzopen()) is a bad > idea. > It will cause a lot of duplicate code. It was just a proposal. Being so easy to modify the code, I did it, so you could examine it directly. > Wouldn't it be better to add Gzip support directly into tarlib? Yes, it is another solution - use gzopen() instead of fopen and the like. gz* functions can handle uncompressed files. In this case, ye'd better provide a tgzlib.h header. Its content would be something like #include "tarlib.h" typedef tarfile tgzfile; #define tgzl_getfilelist tl_getfilelist [...] Well, when handling compressed tar archives you have two options: 1. handle them directly 2. use a temporary file (first uncompress the archive, then open it). I thought that as long as .tar.gz archives are the most common compressed tar archives, it would be more efficient to handle them directly. Obviously, I'm not going to write separate code for e.g. .tar.Z archives. Please, let me know what you think about this issue. Giovanni -- Max, could you please feed my cat? Heisenberg says he can't. Bye, Schroedinger |