patch: unzip succeeds with CRC errors

Michael S. Zick mszick at morethan.org
Mon Mar 27 09:34:28 PST 2006


On Mon March 27 2006 11:15, Paul Fox wrote:
>  > On Fri, Mar 24, 2006 at 03:29:47PM -0500, Paul Fox wrote:
>  > > i assume unzip should return failure in the presence of
>  > > crc errors, correct?  i'll apply this unless there are
>  > > objections.
>  > 
>  > It should return failure, but not exit immediately. A corrupt file you
>  > can try to recover data from is better than no file at all..
> 
> the errors are detected at file granularity -- so if you are trying to
> unzip the whole archive, unzip will now stop after (fully extracting)
> the first bad file, and won't process the rest of the archive. 
> any individual file can still be extracted on its own, with
> resulting success or failure.
> 
A small user comment...
Is that logic required?

If you are going to stop after detecting a bad file crc, why leave 
the bad file on the filesystem?

If you are going to leave the file on the filesystem - why not mark it
as failed (your choice of marker) and just continue?  

Why make the user dig through the catalog of files in the archive and 
extract them by name after a bad file crc?

Why not use logic similar to that of 'patch'? Just mark failed files
and continue to process the balance of the archive.
Much easier on the end-user that way.

Mike


More information about the busybox mailing list