ZIP UNZIP con FWH

ZIP UNZIP con FWH

Postby mmercado » Fri Jan 25, 2008 4: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
User avatar
mmercado
 
Posts: 782
Joined: Wed Dec 19, 2007 7:50 am
Location: Salamanca, Gto., México

Postby ADBLANCO » Fri Jan 25, 2008 4: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( <cFile>, <cFileToCompress> | <aFiles>, <nLevel>, <bBlock>, <lOverwrite>, <cPassword>, <lWithPath>, <lWithDrive>, <pFileProgress> )
// 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!
User avatar
ADBLANCO
 
Posts: 299
Joined: Mon Oct 22, 2007 3:03 pm
Location: Valencia - Venezuela

Postby ADBLANCO » Fri Jan 25, 2008 4:59 pm

Se me olvidaba un ejemplo de llamada

Grabazip("\costosw\",{"*.dbf","*.mem","*.rp*"})
User avatar
ADBLANCO
 
Posts: 299
Joined: Mon Oct 22, 2007 3:03 pm
Location: Valencia - Venezuela

Postby carlos vargas » Fri Jan 25, 2008 8: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)
User avatar
carlos vargas
 
Posts: 1688
Joined: Tue Oct 11, 2005 5:01 pm
Location: Nicaragua

Postby carlos vargas » Fri Jan 25, 2008 8: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)
User avatar
carlos vargas
 
Posts: 1688
Joined: Tue Oct 11, 2005 5:01 pm
Location: Nicaragua

Postby mmercado » Sat Jan 26, 2008 1:55 am

Muchísimas Gracias Angel y Carlos

Manuel Mercado
User avatar
mmercado
 
Posts: 782
Joined: Wed Dec 19, 2007 7:50 am
Location: Salamanca, Gto., México


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 17 guests