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

Thread

Thread Index

Message

From: Krzesimir Nowak <qdlacz%gmail.com@localhost>
To: Dieter Baron <dillo%nih.at@localhost>
Subject: Re: Seeking and telling functions in libzip
Date: Sun, 12 Jul 2009 11:10:18 +0200

On Sun, 2009-07-12 at 00:05 +0200, Dieter Baron wrote:
> 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?

ftell especially - it would make remembering current position problem
nonexistent. As for fseek - I needed it only to seek from beginning, so
it saved me a problem of implementing it on my own using zip_stat and
zip_fread for seeking from the end of file (or from current position,
which would be even more problematic). 

Krzesimir Nowak

Made by MHonArc.