comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: reading compressed files
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: reading compressed files [message #46941] Tue, 10 January 2006 09:43
Norbert Hahn is currently offline  Norbert Hahn
Messages: 46
Registered: May 2003
Member
"Klaus Scipal" <ks@ipf.tuwien.ac.at> wrote:

> Hi
>
> I have to read compressed files with IDL. As I can not read the files using
> the compress keyword (I don't know why, but if I open the file using the
> compress keyword I do not get what I expect)

There are several methods to compress a file. IDL used GZIP to compress/
inflate a file using the freely available ZLIB library. Unfortunately
the zip compression used on computers with MS Windows uses a different
algorithm to compress the data. PKWARE Inc. is the company that implemented
that compression.

> I spawn a winzip command, unzip
> the file first and read it in with the normal IDL commands. In principal
> everything works fine, at least if the compressed file is not corrupted,

So you definately have PKzip compressed data. You may look at the file with
some ascii editor, the first two letters should be PK then. A gzip compressed
file starts with unprintable characters, the hex code (magic number) is
0x1f8b.

> i.e. winzip can not extract the content of the archive because of some
> missing blocks. As I have to read thousands of files I wonder if there is a
> simple way to check if a compressed file is ok.

zip repair is freely available to repair a slightly damaged PKzip compressed
file. zipfix is another utility to repair damaged zip files. To check for
damage zip files must be read and the checksum must be computed for each
block and compared the the checksum stored with the block.

Norbert
[Message index]
 
Read Message
Previous Topic: reading compressed files
Next Topic: Returning Values in iTools

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 07:12:30 PDT 2025

Total time taken to generate the page: 0.80247 seconds