HB_UnzipFile()

HB_UnzipFile()

Postby Baxajaun » Sat Feb 11, 2017 4:30 pm

Hola,

HB_UnzipFile() no funciona correctamente si tu fichero zip contiene ficheros y directorios.

Gracias a Juan Kazmirchuk con esta función se corrige el problema.

Code: Select all  Expand view

//-----------------------------------------------------------------------------
// Juan Kazmirchuk
//-----------------------------------------------------------------------------
FUNCTION my_UnZipFile( cFile, bBlock, lWithPath, cPassword, cPath )
  LOCAL lZip
  LOCAL nI
  LOCAL aFiles   := { }
  LOCAL aFolders := { }
  LOCAL nfiles := 0


  // Get files in ZIP
  aFiles := hb_GetFilesInZip( cFile )
  nFiles := len(aFiles)
  // Get folders in ZIP and create at cPath
  FOR nI := 1 TO nFiles

    IF ! HB_DirExists( HB_DirSepToOS( HB_FNameDir( aFiles[nI] ) ) )

      HB_DirCreate( HB_DirSepAdd( cPath ) + HB_DirSepToOS( HB_FNameDir( aFiles[nI] ) ) )

    ENDIF

  NEXT

  // Then UnZIP files in Path folder

  lZip := HB_UnZipFile( cFile, ;
                NIL, ;
                .T., ;
                NIL, ;
                cPath, ;
                aFiles )

RETURN lZip
 


Saludos
User avatar
Baxajaun
 
Posts: 968
Joined: Wed Oct 19, 2005 2:17 pm
Location: Gatika. Bizkaia

Re: HB_UnzipFile()

Postby nageswaragunupudi » Sun Feb 12, 2017 5:36 am

Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: HB_UnzipFile()

Postby Baxajaun » Sun Feb 12, 2017 6:28 am

Thanks a lot Mr. Rao !
User avatar
Baxajaun
 
Posts: 968
Joined: Wed Oct 19, 2005 2:17 pm
Location: Gatika. Bizkaia


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 43 guests