FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour O.T. - xHarbour
Posts: 1380
Joined: Fri Oct 14, 2005 01:28 PM
O.T. - xHarbour
Posted: Thu Mar 21, 2013 10:35 AM

Gente;
Ten una Help (chm y pdf) que dice ser versi贸n 1.1
Alguien tiene una versi贸n posterior?
Mi inter茅s, por ahora, son los par谩metros de la funci贸n HB_ZipFile()

gracias

Resistencia - "Ciudad de las Esculturas"

Chaco - Argentina
Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM
Re: O.T. - xHarbour
Posted: Thu Mar 21, 2013 01:45 PM
HB_ZIPFILE:HB_ZIPFILE()

Create a zip file

Syntax
HB_ZIPFILE( <cFile> , <cFileToCompress> | <aFiles>, <nLevel> ,
<bBlock>,<lOverWrite> ,<cPassword>,<lWithPath>,<lWithDrive>) ---> lCompress
Arguments
<cFile> Name of the zip file

<cFileToCompress> Name of a file to Compress, Drive and/or path can be used

<aFiles> An array containing files to compress, Drive and/or path can be used

<nLevel> Compression level ranging from 0 to 9

<bBlock> Code block to execute while compressing

<lOverWrite> Toggle to overwite the file if exists

<cPassword> Password to encrypt the files

<lWithPath> Toggle to store the path or not

<lWithDrive> Toggle to store the Drive letter and path or not
Returns
<lCompress> .t. if file was create, otherwise .f.

Description
This function creates a zip file named <cFile>. If the extension is ommited, .ZIP will be assumed. If the second parameter is a character string, this file will be added to the zip file. If the second parameter is an array, all file names contained in <aFiles> will be compressed.

If <nLevel> is used, it detemines the compression type where 0 means no compression and 9 means best compression.

If <bBlock> is used, every time the file is opened to compress it will evaluate bBlock. Parameters of bBlock are cFile and nPos.

If <lOverWrite> is used , it toggles to overwrite or not the existing file. Default is to overwrite the file,otherwise if <lOverWrite> is false the new files are added to the <cFile>.

If <cPassword> is used, all files that are added to the archive are encrypted with the password.

If <lWithPath> is used, it tells thats the path should also be stored with the file name. Default is false.

If <lWithDrive> is used, it tells thats the Drive and path should also be stored with the file name. Default is false.

Examples
Code (fw): Select all Collapse
FUNCTION MAIN()


      IF HB_ZIPFILE( "TEST.ZIP","TEST.PRG")
         qout("File was successly create")
      ENDIF

      IF HB_ZIPFILE( "TEST1.ZIP",{"TEST.PRG","c:\windows\win.ini"})
         qout("File was successly create")
      ENDIF

      IF HB_ZIPFILE( "TEST2.ZIP",{"TEST.PRG","c:\windows\win.ini"},8,{|nPos,cFile|,qout(cFile)})
         qout("File was successly create")
      ENDIF

      aFiles := {"TEST.PRG","c:\windows\win.ini"}
      nLen   := Len(afiles)
      aGauge := GaugeNew( 5, 5, 7,40 , "W/B", "W+/B" ,'脗虏')
      GaugeDisplay( aGauge )
      Hb_ZIPFILE('test33.zip',aFiles,8,{|cFile,nPos| GaugeUpdate(aGauge,nPos/nLen)},,'hello')

Return Nil


Library is zlib.lib and zlib_bor.lib For Borland Compilers Library is zlib.lib zlib_ms.lib for MSVC compilers
Jo茫o Santos - S茫o Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM
Re: O.T. - xHarbour
Posted: Thu Mar 21, 2013 01:51 PM
Jo茫o Santos - S茫o Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 1380
Joined: Fri Oct 14, 2005 01:28 PM
Re: O.T. - xHarbour
Posted: Thu Mar 21, 2013 03:25 PM

Karinha, muchas gracias!

queda pendiente si alguien sabe como obtener una version actualizada de la Ayuda

Resistencia - "Ciudad de las Esculturas"

Chaco - Argentina
Posts: 1380
Joined: Fri Oct 14, 2005 01:28 PM
Re: O.T. - xHarbour
Posted: Thu Mar 21, 2013 03:36 PM

Amplio pregunta;

1) la zlib_bor.lib, no la tengo. No obstante con la zlib sola e podido crear un ejecutable y comprime. Es determinante zlib_bor?

2) Mi intenci贸n es mostrar el avance mediante 2 meter. Uno que muestra el avance en bytes del archivo a comprimir/descomprimir y el segundo meter que muestra el avance segun archivo procesado/total de archivos a comprimir

Resistencia - "Ciudad de las Esculturas"

Chaco - Argentina
Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM
Re: O.T. - xHarbour
Posted: Thu Mar 21, 2013 05:10 PM

total de archivos a comprimir, muestra en una Listbox como en XBACKUP LITE By Carlos vargas.

zlib_bor.lib, tambi茅n no la tengo

salu2

Jo茫o Santos - S茫o Paulo - Brasil - Phone: +55(11)95150-7341

Continue the discussion