[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Re: Zip problems (Re: (no subject))
From:       David Faure <david () mandrakesoft ! com>
Date:       2002-11-18 18:29:18
[Download RAW message or body]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Monday 18 November 2002 19:15, Percy Leonhardt wrote:
> On Monday 18 November 2002 13:55, Nicolas Goutte wrote:
> > Could you please try to replace all "memcmp" by "qstrncmp" in the file
> > kdelibs/kio/kio/kzip.cpp
> >
> > I do not know if we have the same problem, but let check it first. (However
> > this time I am not sure if it is a good fix.)
> 
> Hi Nicolas, tried this but it didn't work.
> 
> I investigated a little bit the zip fileformat and found out why KZip is not 
> able to read OO files. But I have no (good) idea how to fix it, maybe someone 
> on the list has a hint for me.
> 
> Now what I need to do is read from a QIODevice until I find a signature (4 
> bytes large) but the only idea I have is to read byte by byte from the device 
> until I found this signature. Not very effective I guess but when I read 
> larger chunks of data I can never be sure that one part of the signature is 
> in one chunk and the other part is in the next one.
> 
> So what would be an elegant way to find a signature (bytesequence) in a 
> QIODevice?

Are you sure there's no other way than a linear search ???
This sounds utterly broken and slow...

Even if there isn't a way to know where to seek directly, I think the
idea is rather to "read the header for an entry, skip it (after finding out
its length), read the next header, etc." until finding the header for the 
central block.
That's what the code in openArchive tries to do, but for some reason it
can't properly find out the size of the first entry, to know how much to skip...

- -- 
David FAURE, david@mandrakesoft.com, faure@kde.org
http://people.mandrakesoft.com/~david/
Contributing to: http://www.konqueror.org/, http://www.koffice.org/
Get the latest KOffice - http://download.kde.org/stable/koffice-1.2/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE92TF+72KcVAmwbhARAhFLAJwMNalYY5emYweLeZiby0JmpTg00QCfRa+8
xOOkDWhtvbNmPCHP8prKbOg=
=Qzge
-----END PGP SIGNATURE-----

_______________________________________________
koffice-devel mailing list
koffice-devel@mail.kde.org
http://mail.kde.org/mailman/listinfo/koffice-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic