libzip: libzip-discuss: Re: Seeking and telling functions in libzip

Thread

Thread Index

Message

From: Dieter Baron <dillo%danbala.tuwien.ac.at@localhost>
To: libzip-discuss%nih.at@localhost
Subject: Re: Seeking and telling functions in libzip
Date: Sun, 12 Jul 2009 00:06:46 +0200

hi,

> Ever thought about adding functions like zip_fseek, zip_ftell and
> zip_rewind (or zip_fsetpos and zip_fgetpos)?

  zip_ftell and zip_rewind would be easy to do; but zip_ftell would be
very inefficient: you cannot seek in a defalte compressed stream, you
would have to read and discard all data up to where you're trying to
seek.

  Would ftell/rewind without fseek still be useful to you?

> For now substitutes are:
> zip_fseek - using zip_fread and discarding the read data.
> zip_rewind - reopening the file in archive (probably).
> zip_ftell - remembering current position in a variable?

  Yes, sounds reasonable.

                                        yours,
                                        dillo

Made by MHonArc.