List Archive

Thread

Thread Index

Message

From: Dieter Baron <dillo%nih.at@localhost>
To: Andreas Falkenhahn <andreas%falkenhahn.com@localhost>
Subject: Re: Why should I return the size in ZIP_SOURCE_STAT?
Date: Thu, 2 Nov 2017 12:13:13 +0100

hi,

> On 01.11.2017, at 16:17 , Andreas Falkenhahn 
> <andreas%falkenhahn.com@localhost> wrote:
> 
> On 01.11.2017 at 10:10 Dieter Baron wrote:
> 
>> The only information you have to report accurately is
>> ZIP_STAT_COMP_METHOD, and ZIP_STAT_ENCRYPTION_METHOD (and
>> ZIP_STAT_SIZE and ZIP_STAT_CRC if your data is compressed or
>> encrypted). libzip can’t figure those out on its own.
> 
> Hmm, this is still confusing me. I'm not setting any of those
> when adding a file from a source using zip_file_add(). My
> code is just this:
> 
>       case ZIP_SOURCE_STAT: {
>               struct zip_stat *st = (struct zip_stat *) data;         
>               zip_stat_init(st);                                      
>               return sizeof(struct zip_stat);
>               }
> 
> And it's working fine so it looks like none of the ZIP_STAT_XXX
> flags have to be set when adding files using zip_file_add()…

Yes, if you provide uncompressed, unencrypted data, all fields are optional.

What kind of source are you writing?

yours,
dillo

> 
> -- 
> Best regards,
> Andreas Falkenhahn                            
> mailto:andreas%falkenhahn.com@localhost

Made by MHonArc.