Validate ZIP before opening it

Validate ZIP before opening it

Postby Armando » Tue Feb 28, 2023 11:20 pm

Hello friends of the forum:

Is there a function in Harbor that allows you to check if a ZIP file is damaged or corrupt?
before trying to open it?

Greetings
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
User avatar
Armando
 
Posts: 3228
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México

Re: Validate ZIP before opening it

Postby Jimmy » Wed Mar 01, 2023 8:31 am

hi,

every "Packer" have Option
-t Test .ZIP file integrity


---

as long "Standard" Compression is used all "Packer" can handle it but when change Compression Mode there might be Problem
but "max" Compression is not real need any more since "big" HDD/SDD and quick Internet

so "just use ZIP as "Envelope""
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1732
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: Validate ZIP before opening it

Postby Enrico Maria Giordano » Wed Mar 01, 2023 9:14 am

Armando wrote:Hello friends of the forum:

Is there a function in Harbor that allows you to check if a ZIP file is damaged or corrupt?
before trying to open it?

Greetings


Just try to unzip the ZIP file with HB_UNZIPFILE() and check the return value.
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Validate ZIP before opening it

Postby karinha » Wed Mar 08, 2023 8:33 pm

Intenta con:

Code: Select all  Expand view

   ? "The comment in test.zip is:", hb_GetZipComment( "test.zip" )
 


https://harbour.github.io/doc/hbziparc.html

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7826
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 90 guests