Urgent : ZIP - some more questions

Urgent : ZIP - some more questions

Postby driessen » Sat Feb 06, 2010 10:01 am

Hello,

I use FWH 10.1 and the latest xHarbour Builder (Nov. 09).

I have read many topics about zip and unzip, but I have never succeeded in making a working ZIP-exe and UNZIP-exe.

Please can someone provide me with a working example? Which lib-files have to be used ?

Thank you very much in advance.
Last edited by driessen on Fri Feb 12, 2010 1:19 pm, edited 1 time in total.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.02 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc77
User avatar
driessen
 
Posts: 1399
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: Urgent : ZIP

Postby anserkk » Sat Feb 06, 2010 10:55 am

Dear Mr.Michel

Zip & Unzip functions require hbzip.lib and zlib.lib
so Should include the xHarbour Libs hbzip.lib and zlib.lib

Here is a function to extract a zip file including its folder paths

Code: Select all  Expand view
*------------------------------------*
Function ExtractZip(cDrive)
*------------------------------------*
Local aFiles,lOk,cDriveLetter
// Zip and Unzip functions, should include the libs named HbZip & zlib available in \xHarbour\lib
cDriveLetter:=cDrive+"\"  // For eg G:\

// Array containing the list of files in the Zip with Path
aFiles := hb_GetFilesInZip("
Test.Zip")

// The 3rd Parameter should be .T. if you need to extract contents of zip file as per Path
lOk := hb_unzipfile("
Test.Zip",,.T.,,cDriveLetter,aFiles,NIL)
Return lOk


Regards
Anser
User avatar
anserkk
 
Posts: 1331
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: Urgent : ZIP

Postby anserkk » Sat Feb 06, 2010 11:07 am

Dear Mr.Michel,

To create a zip

Code: Select all  Expand view
lOk := hb_ZipFile( cTarget  , ;
                          aFiles , ;
                          nCompress , ;
                          bZip  , ;
                          lOverwrite , ;           // overwrite
                          cPassword  , ;
                          lWithPath,;               // with path
                          lWithDrive  )


Unzip
Code: Select all  Expand view
lOk := hb_UnZipFile( cZip        , ;
                            bOnUnZipFile  , ;
                            lWithSubDir   , ;
                            cPassword     , ;
                            cZipDir + "\" ,;
                            aFiles        ,;
                            bProgress)


http://forums.fivetechsupport.com/viewtopic.php?f=3&t=14682

Regards
Anser
User avatar
anserkk
 
Posts: 1331
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: Urgent : ZIP

Postby vensanto » Sat Feb 06, 2010 11:29 am

hello driessen,

I have build a lib for zip and unzip with xharbour pelles c

if you want, please send an e-mail that i send you

Regard
Santo
User avatar
vensanto
 
Posts: 58
Joined: Thu Oct 13, 2005 1:26 pm
Location: ITALIA

Re: Urgent : ZIP

Postby driessen » Sat Feb 06, 2010 1:20 pm

To Santo.

Please can you send it to info@juda.be ?

Thanks a lot.


To Anser,

I tried to link hpzip.lib and zlib.lib into my application. But I use the commercial xHarbour (Builder) and I got an error "Couldn't build". I think there is a difference between the free xHarbour and the commercial xHarbour.

Any idea what now ?

Thanks a lot for your help.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.02 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc77
User avatar
driessen
 
Posts: 1399
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: Urgent : ZIP

Postby Richard Chidiak » Sat Feb 06, 2010 2:45 pm

Michel

with xharbour commercial you need to link

xhbzipdll.lib
xhbzip.lib

both are located in \xhb\lib

Richard
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
User avatar
Richard Chidiak
 
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France

Re: Urgent : ZIP

Postby vensanto » Sat Feb 06, 2010 4:33 pm

Hello Driessen
i have sended to you the zip library for xharbour

Regards
Santo
User avatar
vensanto
 
Posts: 58
Joined: Thu Oct 13, 2005 1:26 pm
Location: ITALIA

Re: Urgent : ZIP

Postby driessen » Sat Feb 06, 2010 4:46 pm

Santo,

Thanks a lot for your e-mail.

I did some test immediately.

Unfortunately I got an error while linking :
xLINK: error: Unresolved external symbol '__chkstk referenced from winzip.lib(zip.obj)'

Did I miss something ?

Thanks.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.02 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc77
User avatar
driessen
 
Posts: 1399
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: Urgent : ZIP

Postby driessen » Sat Feb 06, 2010 4:50 pm

Hello everybody,

I did some test with linking the libraries xhbzîp.lib and xhbzipdll.lib.

Now I got no errors anymore while compiling and linking.

This is the test I tried :
Code: Select all  Expand view
ZipFiles := hb_GetFilesInZip("C:\TEST.ZIP")
hb_UnZipFile("C:\Test.Zip",,,,"C:\UNZIP\",ZipFiles,NIL)

Unfortunately, I got a GPF on the second line.

Anyone any idea why ?

Thanks.
Last edited by driessen on Sat Feb 06, 2010 4:51 pm, edited 1 time in total.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.02 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc77
User avatar
driessen
 
Posts: 1399
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: Urgent : ZIP

Postby vensanto » Sat Feb 06, 2010 6:40 pm

Hello Driessen

this is the lib correct
http://www.veneziasoft.com/download/winzipok.zip

Regards
Santo
User avatar
vensanto
 
Posts: 58
Joined: Thu Oct 13, 2005 1:26 pm
Location: ITALIA

Re: Urgent : ZIP

Postby driessen » Sat Feb 06, 2010 7:01 pm

Santo,

Thank you very much for all your efforts.

It's working great now.

Regards,
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.02 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc77
User avatar
driessen
 
Posts: 1399
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: Urgent : ZIP

Postby Patrizio » Mon Feb 08, 2010 10:27 am

driessen wrote:Hello everybody,

I did some test with linking the libraries xhbzîp.lib and xhbzipdll.lib.

Now I got no errors anymore while compiling and linking.

This is the test I tried :
Code: Select all  Expand view
ZipFiles := hb_GetFilesInZip("C:\TEST.ZIP")
hb_UnZipFile("C:\Test.Zip",,,,"C:\UNZIP\",ZipFiles,NIL)

Unfortunately, I got a GPF on the second line.

Anyone any idea why ?

Thanks.


Driessen, i have gpf too.

I've resolved with

Code: Select all  Expand view
 
PROC UnZipFile(cFileZip,cDir)
   LOCAL aExtract := HB_GetFilesInZip(cFileZip)
   LOCAL cFile, oErr
   FOR EACH cFile IN aExtract
      TRY
         HB_UnZipFile(cFileZip,,,,cDir,cFile,NIL)
      CATCH oErr
         DO CASE
         CASE oErr:genCode == EG_ZERODIV
         OTHERWISE
            MsgStop(oErr:Description)
            EXIT
         ENDCASE
      END
RETURN
 
Patrizio
 
Posts: 90
Joined: Wed Nov 07, 2007 8:56 am
Location: Italy

Re: Urgent : ZIP

Postby driessen » Mon Feb 08, 2010 2:22 pm

Patrizio,

Thanks a lot for you suggestion.

Regards.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.02 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc77
User avatar
driessen
 
Posts: 1399
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: Urgent : ZIP

Postby driessen » Thu Feb 11, 2010 3:06 pm

Hello,

hb_zipfile() and hb_unzipfile() is working fine now, thanks to all the help of my FWH-friends.

But I have an additional question.

Is it possible to make an executable zip-file in FWH ?

To explain what I mean, I refer to my old DOS-period.

In those days, we had commands like PKZIP.EXE and PKUNZIP.EXE. There was also an ZIP2EXE.EXE which we could use to change a ZIP-file (e.g. TEST.ZIP) into an EXE-file (e.g. TEST.EXE). This executable could be started to UNZIP the file automatically.

I hope I was able to explain my question well.

Thanks a lot in advance for any help.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.02 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc77
User avatar
driessen
 
Posts: 1399
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: Urgent : ZIP - some more questions

Postby driessen » Fri Feb 12, 2010 1:21 pm

Hello,

I have some more questions about hbzipfile() and hbunzipfile().

For my first question, I refer to my previous message with a question about ZIP2EXE. I'm still looking for a solution.

My second question :

How do I handle zipping files from a folder, including all the files in the subfolders ?

Thanks a lot in advance for any help.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.02 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc77
User avatar
driessen
 
Posts: 1399
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Eroni and 34 guests