You can subscribe to this list here.
| 2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
(36) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2001 |
Jan
(21) |
Feb
(63) |
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
|
From: Giovanni C. <val...@li...> - 2000-12-23 16:50:35
|
Simo Sorce wrote:
>
> > /* support functions */
> > int check_file (char* file)
> > {
> > union block block;
> > char* magic;
> > int retval = 0;
> > FILE* fp = fopen(file, "rb");
>
> I think you should use standard file descriptors (open, write, read,
> seek) and not file streams as it is more portable across systems.
I prefer open() calls too, but I found that POSIX-style calls have
nothing like ftell() which I think may be useful, esp. in extracting or
deleting files.
Should my guess happen to be wrong, I'd happily switch to open() calls.
>
> >
> > if (!fp)
> > return -1;
> >
> > if (fread(&block, sizeof(union block), 1, fp) != 1)
> > {
> > fclose(fp);
> > return -1;
> > }
> >
> > magic = block.header.magic;
> >
> > if (memcmp(magic, TMAGIC, sizeof(char)*TMAGLEN))
> > retval = 1; /* posix archive */
> > if (memcmp(magic, OLDGNU_MAGIC, sizeof(char)* 8))
> > retval = 2; /* GNU archive */
>
> Using sizeof(char) in this contest is a bug, file format declares magic
> beeing long 8 bytes!
> This is indipendent from how many bytes a char use on the platform.
> On platforms with chars of greater than 8bit size this would break as
> they will copy more bytes causing possible memory leaks.
I could have used strcmp() as well, but AFAIK memcmp() is more efficient
than strcmp(), even when comparing strings. So I prefered to force a
string comparison by use of memcmp(), but I had to be sure that it would
have compared 8 chars, not 8 bytes.
Do you think I should use strcmp(), instead of this hack?
|
|
From: Hongli L. <ho...@te...> - 2000-12-23 15:04:51
|
On Sat, 23 Dec 2000 13:58:23 Simo Sorce wrote:
> > /* support functions */
> > int check_file (char* file)
> > {
> > union block block;
> > char* magic;
> > int retval = 0;
> > FILE* fp = fopen(file, "rb");
>
> I think you should use standard file descriptors (open, write, read,
> seek) and not file streams as it is more portable across systems.
???????????????
Which OS doesn't support file streams?
Isn't file streams part of ANSI C?
And are you suggesting fdopen() instead of fopen() ?
> > if (memcmp(magic, TMAGIC, sizeof(char)*TMAGLEN))
> > retval = 1; /* posix archive */
> > if (memcmp(magic, OLDGNU_MAGIC, sizeof(char)* 8))
> > retval = 2; /* GNU archive */
>
> Using sizeof(char) in this contest is a bug, file format declares magic
> beeing long 8 bytes!
> This is indipendent from how many bytes a char use on the platform.
> On platforms with chars of greater than 8bit size this would break as
> they will copy more bytes causing possible memory leaks.
So should I change "sizeof(char) * 8" to 8
and "sizeof(char)*TMAGLEN" to TMAGLEN?
|
|
From: Simo S. <sim...@ti...> - 2000-12-23 12:59:46
|
Some comments on the code:
Giovanni Corriga wrote:
>
> Hi!
>
> I'm sending a new version of tarlib that can be put in CVS tree. Now the
> source code is cleaner and safer.
>
> The only high level function which is present is tl_getfilelist(). It
> does support only regular files (no long names yet) and directories. The
> only info you can get from archive is the name of each file, its type
> and its size.
> .tar.gz and .tar.bz2 files are not supported yet.
>
> It is not much, but with this Gnomezip should be able to display .tar
> files' content.
>
> Bye
> Giovanni
>
> PS. Hongli, you can add my name to the website now (Thanks!). BTW, can I
> have a CVS account, please?
>
...snip...
> ------------------------------------------------------------------------
> /*
> * tarlib.c
> *
> * Tarlib: a library to handle .tar files
> * Copyright (C) 2000 Giovanni Corriga (Valkadesh)
> *
> * Based upon the GNU tar program source code
> * GNU tar is copyright (C) 1999 Free Software Foundation
> */
>
> /*
...snip...
> /* support functions */
> int check_file (char* file)
> {
> union block block;
> char* magic;
> int retval = 0;
> FILE* fp = fopen(file, "rb");
I think you should use standard file descriptors (open, write, read,
seek) and not file streams as it is more portable across systems.
>
> if (!fp)
> return -1;
>
> if (fread(&block, sizeof(union block), 1, fp) != 1)
> {
> fclose(fp);
> return -1;
> }
>
> magic = block.header.magic;
>
> if (memcmp(magic, TMAGIC, sizeof(char)*TMAGLEN))
> retval = 1; /* posix archive */
> if (memcmp(magic, OLDGNU_MAGIC, sizeof(char)* 8))
> retval = 2; /* GNU archive */
Using sizeof(char) in this contest is a bug, file format declares magic
beeing long 8 bytes!
This is indipendent from how many bytes a char use on the platform.
On platforms with chars of greater than 8bit size this would break as
they will copy more bytes causing possible memory leaks.
>
> fclose(fp);
>
> return retval;
> }
>
...snip...
--
sim...@ti...
http://www.geocities.com/SiliconValley/9757
|
|
From: Hongli L. <ho...@te...> - 2000-12-21 16:21:52
|
I just committed garp-tar.[ch], the tarlib wrapper. Everything works just fine. |
|
From: Hongli L. <ho...@te...> - 2000-12-20 14:16:15
|
On Wed, 20 Dec 2000 13:24:24 Giovanni Corriga wrote: > Hi! > > I'm sending a new version of tarlib that can be put in CVS tree. Now the > source code is cleaner and safer. Committed. > .tar.gz and .tar.bz2 files are not supported yet. You shouldn't. It's better to create separated classes for them. > PS. Hongli, you can add my name to the website now (Thanks!). BTW, can I > have a CVS account, please? I want to, but I'm trying to upload the updated HTML files for days now, without any success. I did update the AUTHORS file. |
|
From: Giovanni C. <val...@li...> - 2000-12-20 13:00:11
|
Hi! I'm sending a new version of tarlib that can be put in CVS tree. Now the source code is cleaner and safer. The only high level function which is present is tl_getfilelist(). It does support only regular files (no long names yet) and directories. The only info you can get from archive is the name of each file, its type and its size. .tar.gz and .tar.bz2 files are not supported yet. It is not much, but with this Gnomezip should be able to display .tar files' content. Bye Giovanni PS. Hongli, you can add my name to the website now (Thanks!). BTW, can I have a CVS account, please? |
|
From: Simo S. <sim...@ti...> - 2000-12-19 19:50:32
|
Hongli Lai wrote: > > Looks good. But you should only use standard functions (ANSI C, POSIX, > BSD). > And use Glib functions/types whenever possible (g_new0 instead of malloc). Yes we definetly will use glib as it is available on all unices and is indeed a very good utility library. I will take a look this evening and report you after that. bye, Simo. -- sim...@ti... http://www.geocities.com/SiliconValley/9757 |
|
From: Hongli L. <ho...@te...> - 2000-12-19 18:57:05
|
Looks good. But you should only use standard functions (ANSI C, POSIX, BSD). And use Glib functions/types whenever possible (g_new0 instead of malloc). |
|
From: Giovanni C. <val...@li...> - 2000-12-18 22:35:32
|
Sorry, I sent you the wrong file... Giovanni |
|
From: Giovanni C. <val...@li...> - 2000-12-18 21:45:18
|
Hongli Lai wrote: > > How bad is the original code? > If it's not that bad, you may use the first way. > But if it is, please use the 2nd way. > Well, it is not really bad: just messy. It was certainly written by someone who still (in '85) haven't heard about OOP: global variables (and functions with no args), and the like. I think it is easier to re-write the functions we need, using the original code as a guide. |
|
From: Giovanni C. <val...@li...> - 2000-12-18 21:45:18
|
Hongli Lai wrote: > > Giovanni, shall I add your name to the website? > Let's wait till I have done a more substantial contribution (as is, when tl_getfilelist() is working ;-)) |
|
From: Giovanni C. <val...@li...> - 2000-12-18 21:44:20
|
Simo Sorce wrote: > > Giovanni, have you something new about libtar? > Remember to use big-endian/little-endian safe code! (look at ziplib) I have written some basic function (tlbopen() to open .tar file; tlbread() to read a 512 bytes block; etc), and right now I'm writing the tl_getfilelist() function. I'm attaching tarlib.c, so you can review my work. Please note that this is just a draft. When tl_getfilelist() will be roughly working, I'll start making the code more robust (is this the right word? :-P) PS: Can the list manager set the Reply To option of mailman to the list address? |
|
From: Simo S. <sim...@ti...> - 2000-12-18 20:28:34
|
Hongli Lai wrote: > > I am planning to release a version 0.1 within a few months (or weeks). > Al least these has to be done before release: > > LibGarp: > * Content listing support (already implemented for Zip and Gzip) > Tar support must be finished. > * Extraction support. Gzip extraction support is finished. > Ziplib extraction support must be finished (Simo?), I will take > care of the LibGarp wrapper (GarpZip) Well I will do my best to get soon an usable code! Giovanni, have you something new about libtar? Remember to use big-endian/little-endian safe code! (look at ziplib) > > GnomeZip: > * Text viewer must be finished (Save As, open in other programs) > * Every window must have an icon > * Open file dialog: Implement Rename button If I have time, I will look also at GnomeZip interface! by Simo -- sim...@ti... http://www.geocities.com/SiliconValley/9757 |
|
From: Hongli L. <ho...@te...> - 2000-12-18 15:31:45
|
I am planning to release a version 0.1 within a few months (or weeks). Al least these has to be done before release: LibGarp: * Content listing support (already implemented for Zip and Gzip) Tar support must be finished. * Extraction support. Gzip extraction support is finished. Ziplib extraction support must be finished (Simo?), I will take care of the LibGarp wrapper (GarpZip) GnomeZip: * Text viewer must be finished (Save As, open in other programs) * Every window must have an icon * Open file dialog: Implement Rename button That's it for now. Not really much... |
|
From: Hongli L. <ho...@te...> - 2000-12-18 14:55:14
|
Giovanni, shall I add your name to the website? |
|
From: Hongli L. <ho...@te...> - 2000-12-18 14:54:00
|
How bad is the original code? If it's not that bad, you may use the first way. But if it is, please use the 2nd way. |
|
From: Hongli L. <ho...@te...> - 2000-12-18 14:52:25
|
look out for bad englisch |
|
From: Hongli L. <ho...@te...> - 2000-12-18 14:49:48
|
subscribed :) |
|
From: Simo S. <sim...@ti...> - 2000-12-14 20:10:29
|
Giovanni Corriga wrote: > > Hi! > > I've downloaded GNU tar 1.13 source code, and I've started writing the > code for opening/closing/content-listing tar file. But, I have a > question. > My doubt is whether I should use the original source code, patching it a > little, or should I write some brand new code, using the original one as > reference? > Please note that the original code is a real mess. Thus, I'd prefer the > latter solution, even though the former is easier. > > May I have your opinion? > > Thanks, > Giovanni > Hi, Giovanni, I think you should make the tarlib as a separated indipendent library (as libzip) and when it is ready rewrite/adapt the libgrap functions that will use that library. I'm very interested in libtar and from next thursday I will be at home so I will have really much more time to hack on GnomeZip and gnozip, I hope we may ret in close contact after next wednesday so that we may give a boost to libgarp/gnomezip development. bye, Simo. -- sim...@ti... http://www.geocities.com/SiliconValley/9757 |
|
From: Giovanni C. <val...@li...> - 2000-12-14 19:42:34
|
Hi! I've downloaded GNU tar 1.13 source code, and I've started writing the code for opening/closing/content-listing tar file. But, I have a question. My doubt is whether I should use the original source code, patching it a little, or should I write some brand new code, using the original one as reference? Please note that the original code is a real mess. Thus, I'd prefer the latter solution, even though the former is easier. May I have your opinion? Thanks, Giovanni |
|
From: Simo S. <sim...@ti...> - 2000-12-06 22:00:18
|
Giovanni Corriga wrote: > > Simo Sorce wrote: > > > > Giovanni Corriga wrote: > > > > > > Hi everyone. > > > > > > Two things: > > > > > > 1) I'd like to give some help to you guys, but the TODO file I found with the > > > CVS snapshot (12/03/00) is empty. Is it OK for you if start writing something to > > > handle tar files? > > > > what do you have in mind exactly? > > I think I will try to implement a tar library the same way I'm > > implementing the ziplib, would you take that in charge? > > Yes, I think I can. Right now I'm looking for .tar file format info. > BTW, can you send me the latest Libgarp API specification draft? Hongli, may you post it on the website? -- sim...@ti... http://www.geocities.com/SiliconValley/9757 |
|
From: Giovanni C. <val...@li...> - 2000-12-05 21:55:46
|
Simo Sorce wrote: > > Giovanni Corriga wrote: > > > > Hi everyone. > > > > Two things: > > > > 1) I'd like to give some help to you guys, but the TODO file I found with the > > CVS snapshot (12/03/00) is empty. Is it OK for you if start writing something to > > handle tar files? > > what do you have in mind exactly? > I think I will try to implement a tar library the same way I'm > implementing the ziplib, would you take that in charge? Yes, I think I can. Right now I'm looking for .tar file format info. BTW, can you send me the latest Libgarp API specification draft? Bye Giovanni |
|
From: Giovanni C. <val...@li...> - 2000-12-04 22:25:46
|
Hi everyone. Two things: 1) I'd like to give some help to you guys, but the TODO file I found with the CVS snapshot (12/03/00) is empty. Is it OK for you if start writing something to handle tar files? 2) I have compiled gnomezip in a /usr/local/src/ subdir, and installed with 'make install'. After that, I cd'ed to my home directory, and tried to run gnomezip, but I had _many_ glade-xml errors, due to the fact that the installation process did not copy gnomezip.glade to /usr/local/share/gnomezip/. Since I don't know anything about autoconf/automake, can someone else solve this bug? Bye Giovanni PS. Where can I find you on IRC? |
|
From: Simo S. <sim...@ti...> - 2000-11-30 22:41:36
|
Giovanni Corriga wrote: > > Hello? > Is there anyone? > > Giovanni > Hi the list has not been much used, but development is continuing. Lately I provided a custom library to open multiple zip files (decompression will come soon), and compression will come after that. Hongli has continued development both on libgarp and gnomezip, he has added gzip and zip (through ziplib) file listing support in libgarp and is working on the gnomezip interface. Download the latest cvs to see the code :) Bye, Simo. -- sim...@ti... http://www.geocities.com/SiliconValley/9757 |
|
From: Giovanni C. <val...@li...> - 2000-11-30 11:42:12
|
Hello? Is there anyone? Giovanni |