ZipinputStream tellg() returns -1?

A general discussion forum.
Posts: 24
Joined: 13 May 2009, 17:14

ZipinputStream tellg() returns -1?

Postby budric » 05 Jun 2013, 17:34


Can I use tellg() and seekg() with this stream? The following returns -1.

Code: Select all

std::ifstream inp(pathToZip, std::ios_base::binary);
ZipArchive archive(inp);   
for (ZipArchive::FileHeaders::const_iterator headerIt = archive.headerBegin(); headerIt != archive.headerEnd(); ++headerIt)
    if (!headerIt->second.hasData()) continue;      //it's just a folder entry not a file
    ZipInputStream zipin(inp, headerIt->second);
    long pos = zipin.tellg();             //-1

I'm using 1.4.6-all (not p1). I checked changelogs there has been no mention of fixes in p1 for Zip


Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 2 guests