Overview
Features
Download
Documentation
Community
Add-Ons & Services

poco::zip

Please post support and help requests here.
badreddine
Posts: 4
Joined: 15 Jun 2008, 14:16

poco::zip

Postby badreddine » 18 Nov 2008, 10:56

Hello all,

I want to retreive the rights access of a file in a zip file ( a zip file witch contains many files)

if i use:

Code: Select all


    ifstream l_Inputstream("DOCS.zip", std::ios::binary);
    if(l_Inputstream)
    {
        ZipArchive Arch(l_Inputstream);

       ZipArchive::FileHeaders::const_iterator it = Arch.findHeader("toto.txt"); //toto.txt is the file in the archive DOCS.zip
   }

I can't wtih this iterator it retreive the file attributes ( read/write,)
also i used the method with Decompress class but i noticed that the access of the file toto is always R/W even if set it ReadOnly !!

Please, can you help me to retreive the rights access of this file toto.txt

Thank you a lot


--
BARHOUMI Badreddine

peter
Posts: 67
Joined: 11 Jul 2006, 16:26
Location: Austria

Re: poco::zip

Postby peter » 19 Nov 2008, 09:23

> Hello all,
>
> I want to retreive the rights access of a file in a zip file ( a zip file witch contains many files)
>
> if i use:
>

Code: Select all


>     ifstream l_Inputstream("DOCS.zip", std::ios::binary);
>     if(l_Inputstream)
>     {
>         ZipArchive Arch(l_Inputstream);
>
>        ZipArchive::FileHeaders::const_iterator it = Arch.findHeader("toto.txt"); //toto.txt is the file in the archive DOCS.zip
>    }
>

> I can't wtih this iterator it retreive the file attributes ( read/write,)
> also i used the method with Decompress class but i noticed that the access of the file toto is always R/W even if set it ReadOnly !!
>
> Please, can you help me to retreive the rights access of this file toto.txt
>
> Thank you a lot

This is not supported in the current implementation of PocoZip.
If you take a look at the ZipSpecs (in doc folder) this would require
setting and interpreting the external file attributes field of the
the file header in the Central directory structure.Interpretation of
the values is platform dependent and I couldn't find any information on how to do that.

You are more than welcome to add this feature to PocoZip (ZipFileInfo must be extended).

There is already a getExternalFileAttributes method, you can build on that one
(add a public isReadOnly method which uses getExternalFileAttributes).
But PocoZip doesnot set this field, so this would be needed too.
That's about as much help as I can give you here :-)

br

Peter

>
>
> --
> BARHOUMI Badreddine


Return to “Support”

Who is online

Users browsing this forum: No registered users and 3 guests