FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour ZIP UNZIP con FWH
Posts: 782
Joined: Wed Dec 19, 2007 07:50 AM
ZIP UNZIP con FWH
Posted: Fri Jan 25, 2008 04:17 PM

En 16 bits lo hacía muy bien con barra de progreso y toda la cosa.

Como funciona con (x)Harbour?, Existen las Funciones?, cual es la sintaxis?, las funciones muestran el avance del proceso ?, se requiere una DLL ?

TestZip.prg en FWH\Samples es para 16 bits, hay algún ejemplo para 32 bits?

Gracias de antemano por su ayuda.

Manuel Mercado

manuelmercado at prodigy dot net dot mx
Posts: 299
Joined: Mon Oct 22, 2007 03:03 PM
ZIP UNZIP con FWH
Posted: Fri Jan 25, 2008 04:55 PM

Agarra este trompo en la uña (Dicho Venezolano)


static procedure GrabaZip(cOrig,aFileList)


local cFile ,;
aFiles,;
nItem,;
cString,;
cReturn:="",;
nI,;
na,;
aFil,;
cFilepath,;
lContinue

cFile:=cGetFile( "*.zip","Seleccione Archivo a Exportar" )
if len(alltrim(cFile))<>0
lContinue:=.t.
if file(cfile)
if !MsgNoYEs("Archivo Ya Existe, Desea Sobre-Escribir","Exportar")
lContinue:=.f.
endif
endif
if lContinue
cursorwait()
cFilePath := AllTrim( cOrig )
for nI=1 to len(aFilelist)
cReturn += AllTrim( cOrig ) +aFilelist[nI]
next
cString := cReturn

 aFiles := {}
 for nI=1 to len(aFilelist)
   aFil := Directory( ( cFilePath +aFilelist[nI] ) )
   //aEval( aFil, { | uFile | AAdd( aFiles, uFile ) } )
     for  na=1 to len(afil)
      AAdd( aFiles, afil[na,1] )
        next
   next

 // HB_ZipFile( &lt;cFile&gt;, &lt;cFileToCompress&gt; | &lt;aFiles&gt;, &lt;nLevel&gt;, &lt;bBlock&gt;, &lt;lOverwrite&gt;, &lt;cPassword&gt;, &lt;lWithPath&gt;, &lt;lWithDrive&gt;, &lt;pFileProgress&gt; )
 // cFile: filename of the zip file.
 // cFileToCompress | aFiles: a file or a list (array) of files to compress.
 // nLevel: compression level (value from 0 to 9).
 // Block: code block to execute while compressing.
 // lOverWrite: overwrite existing files or not.
 // cPassword: password to encrypt the files.
 // lWithPath: store the file path or not.
 // lWithDrive: store the drive letter and path or not.
 // pFileProgress: code block for file progress.

 HB_ZIPFILE( cfile, afiles,,,,, .t. )
   cursorarrow()
   *wqout( HB_GetFilesInZip( cfile ) )
 endif

endif

return


static procedure LeeZip()


local cFile ,;
aFiles,;
nItem

cFile:=cGetFile( ".zip","Seleccione Archivo a Importar" )
if len(alltrim(cFile))<>0
if msgnoyes('Archivos en el Sistema Seran Sustituidos, Desea Continuar',"Importar")
aFiles :=HB_GetFilesInZip( cFile )
HB_UNZIPFILE( cFile, { | x, y | QOUT( "Archivo ", STR( y, 1 ), " se está extrayendo." ) },,, '.\', aFiles )
//for nItem:=1 to len( aFiles )
// HB_UNZIPFILE( "Angelito.zip", { | x, y | QOUT( "Archivo ", STR( y, 1 ), " se está extrayendo." ) },,, '.\', aFiles[ nItem ] )
// next
delfile('','
.cdx')
MsgMeter( { | oMeter, oText, oDlg | reindexa(oMeter, oText, oDlg)} )
n_use('Acceso','=',exclusivo,0)
endif
endif

return

// oMeter:nTotal :=len( aPrint )*oNomina:nCopias
// oMeter:nRefresh :=Int( oMeter:nTotal/100 )
// if oMeter:nRefresh<1
// oMeter:nRefresh :=1
// endif

y encadenas la siguiente librería:

hbzip.lib

Suerte!

Saludos



Angel, Valencia, Venezuela



xH .997 - FW 7.9 - BCC55 - WorkShop - MySql
Posts: 299
Joined: Mon Oct 22, 2007 03:03 PM
ZIP UNZIP con FWH
Posted: Fri Jan 25, 2008 04:59 PM

Se me olvidaba un ejemplo de llamada

Grabazip("\costosw\",{".dbf",".mem",".rp"})

Saludos



Angel, Valencia, Venezuela



xH .997 - FW 7.9 - BCC55 - WorkShop - MySql
Posts: 1789
Joined: Tue Oct 11, 2005 05:01 PM
ZIP UNZIP con FWH
Posted: Fri Jan 25, 2008 08:32 PM

Estimado maestro

aca una aplicación completa, el exe esta en el dir bin :-)
comprime y descomprime, barra de progreso y listado de ficheros con tsbrowse :-)

se llama backuplite

salu2
carlos vargas

Salu2

Carlos Vargas

Desde Managua, Nicaragua (CA)
Posts: 1789
Joined: Tue Oct 11, 2005 05:01 PM
ZIP UNZIP con FWH
Posted: Fri Jan 25, 2008 08:33 PM

se me paso el link

http://rapidshare.com/files/86591177/blite.zip.html

salu2
carlos vargas

:-)
Salu2

Carlos Vargas

Desde Managua, Nicaragua (CA)
Posts: 782
Joined: Wed Dec 19, 2007 07:50 AM
ZIP UNZIP con FWH
Posted: Sat Jan 26, 2008 01:55 AM

Muchísimas Gracias Angel y Carlos

Manuel Mercado

manuelmercado at prodigy dot net dot mx

Continue the discussion