Re: [library(archive)] How to correctly use?

Jan Wielemaker <[email protected]> Mon, 21 Apr 2014 17:15:05 +0200
Newsgroups gmane.comp.ai.prolog.swi
Message-ID <[email protected]>
On 04/20/2014 06:04 PM, Wouter Beek wrote:
> Hi Prologgers,
> 
> I'm trying to use `library(archive)` and would like to be able to
> reproduce behavior I can also achieve with a GNU tool such as gunzip.
> 
> Archive file size in gunzip:
> ~~~{.sh}
> $ gunzip -l elezione.rdf.gz
>          compressed        uncompressed  ratio uncompressed_name
>              330649             6879677  95.2% elezione.rdf
> ~~~
> 
> Trying to receive the same information using `library(archive)`:
> ~~~{.pl}
> ?- archive_open('elezione.rdf.gz', Archive,
> [format(all),format(raw)]), archive_next_header(Archive, Path),
> archive_header_property(Archive, size(Size)).
> Archive = <archive>(0x8ac480),
> Path = data,
> Size = 0.
> ~~~
> 
> Any ideas and/or sharing of experience with this library by others is
> very much appreciated.

You're almost there.  Just call archive_open_entry/2 and you have a stream.

	Cheers --- Jan

> 
> ---
> Cheers!,
> Wouter.
> 
> E-mail: [email protected]
> WWW: www.wouterbeek.com
> Tel.: 0647674624
> _______________________________________________
> SWI-Prolog mailing list
> [email protected]
> https://lists.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog
>