fluna Posted October 1, 2011 Report Share Posted October 1, 2011 Companheiros, to tentando criar um arquivo .zip de uma determinada pasta, que possui várias sub pastas, o hb_zip cria o zip, mas as subpastas ficam VAZIAS , os arquivos dentro das subpastas não estão sendo incluidos no .zip... alguem pode me ajudar? xharbour 0.99.50 (simplex); fwh6.2(free),hbmake,Qedit(dos;PspPad Editor Quote Link to comment Share on other sites More sharing options...
fluna Posted October 1, 2011 Author Report Share Posted October 1, 2011 Companheiros, to tentando criar um arquivo .zip de uma determinada pasta, que possui várias sub pastas, o hb_zip cria o zip, mas as subpastas ficam VAZIAS , os arquivos dentro das subpastas não estão sendo incluidos no .zip... alguem pode me ajudar? xharbour 0.99.50 (simplex); fwh6.2(free),hbmake,Qedit(dos;PspPad Editor Quote Link to comment Share on other sites More sharing options...
Theotokos Posted October 1, 2011 Report Share Posted October 1, 2011 faço assim, vê se te ajuda: cZipDir := cDriver+"\BKP"+DtoS(Date()) cArqDir := curdrive()+":\"+GetCurDir() If File(cZipDir) Ferase( cZipDir ) End If lDbf aTable := Directory( cArqDir+"\DBF\*.DB?" ) For n1 := 1 To Len(aTable) If !(lCP) If "BANPAGAR" $ Upper(aTable[n1,1]) .Or. "MPAGAR" $ Upper(aTable[n1,1]) .Or. ; "FPAGAMEN" $ Upper(aTable[n1,1]) .Or. "CATEGORI" $ Upper(aTable[n1,1]) Loop end End AADD(aFiles, cArqDir+"\DBF\"+aTable[n1,1]) Next aTable := Directory( cArqDir+"\DBF\PRAZO\*.DB?" ) For n1 := 1 To Len(aTable) AADD(aFiles, cArqDir+"\DBF\PRAZO\"+aTable[n1,1]) Next aTable := Directory( cArqDir+"\DBF\BANCO\*.DB?" ) For n1 := 1 To Len(aTable) AADD(aFiles, cArqDir+"\DBF\BANCO\"+aTable[n1,1]) Next End If lBmp aTable := Directory( cArqDir+"\BMP\*.*" ) For n1 := 1 To Len(aTable) AADD(aFiles, cArqDir+"\BMP\"+aTable[n1,1]) Next End If lNtx aTable := Directory( cArqDir+"\NTX\*.*" ) For n1 := 1 To Len(aTable) AADD(aFiles, cArqDir+"\NTX\"+aTable[n1,1]) Next End If lExe aTable := Directory( cArqDir+"\ARQUIVOS\*.*" ) For n1 := 1 To Len(aTable) AADD(aFiles, cArqDir+"\ARQUIVOS\"+aTable[n1,1]) Next End If lDoc aTable := Directory( cArqDir+"\OS\*.*" ) For n1 := 1 To Len(aTable) AADD(aFiles, cArqDir+"\OS\"+aTable[n1,1]) Next End If lExe aTable := Directory( "*.*" ) For n1 := 1 To Len(aTable) AADD(aFiles, cArqDir+"\"+aTable[n1,1]) Next End oMeter:SetTotal(Len(aFiles)) oMeter:SET(nLidos) nLevel := 9 lOverWrite := .t. cPassword := "" lWithPath := .t. lWithDrive := .t. w_ok := HB_ZIPFILE(cZipDir, aFiles, nLevel, {|cF| nLidos++, oMeter:SET(nLidos), oMeter:cText := cF }, lOverWrite, cPassWord, lWithPath, lWithDrive ) id=code>id=code> Quote Link to comment Share on other sites More sharing options...
Theotokos Posted October 1, 2011 Report Share Posted October 1, 2011 faço assim, vê se te ajuda: cZipDir := cDriver+"\BKP"+DtoS(Date()) cArqDir := curdrive()+":\"+GetCurDir() If File(cZipDir) Ferase( cZipDir ) End If lDbf aTable := Directory( cArqDir+"\DBF\*.DB?" ) For n1 := 1 To Len(aTable) If !(lCP) If "BANPAGAR" $ Upper(aTable[n1,1]) .Or. "MPAGAR" $ Upper(aTable[n1,1]) .Or. ; "FPAGAMEN" $ Upper(aTable[n1,1]) .Or. "CATEGORI" $ Upper(aTable[n1,1]) Loop end End AADD(aFiles, cArqDir+"\DBF\"+aTable[n1,1]) Next aTable := Directory( cArqDir+"\DBF\PRAZO\*.DB?" ) For n1 := 1 To Len(aTable) AADD(aFiles, cArqDir+"\DBF\PRAZO\"+aTable[n1,1]) Next aTable := Directory( cArqDir+"\DBF\BANCO\*.DB?" ) For n1 := 1 To Len(aTable) AADD(aFiles, cArqDir+"\DBF\BANCO\"+aTable[n1,1]) Next End If lBmp aTable := Directory( cArqDir+"\BMP\*.*" ) For n1 := 1 To Len(aTable) AADD(aFiles, cArqDir+"\BMP\"+aTable[n1,1]) Next End If lNtx aTable := Directory( cArqDir+"\NTX\*.*" ) For n1 := 1 To Len(aTable) AADD(aFiles, cArqDir+"\NTX\"+aTable[n1,1]) Next End If lExe aTable := Directory( cArqDir+"\ARQUIVOS\*.*" ) For n1 := 1 To Len(aTable) AADD(aFiles, cArqDir+"\ARQUIVOS\"+aTable[n1,1]) Next End If lDoc aTable := Directory( cArqDir+"\OS\*.*" ) For n1 := 1 To Len(aTable) AADD(aFiles, cArqDir+"\OS\"+aTable[n1,1]) Next End If lExe aTable := Directory( "*.*" ) For n1 := 1 To Len(aTable) AADD(aFiles, cArqDir+"\"+aTable[n1,1]) Next End oMeter:SetTotal(Len(aFiles)) oMeter:SET(nLidos) nLevel := 9 lOverWrite := .t. cPassword := "" lWithPath := .t. lWithDrive := .t. w_ok := HB_ZIPFILE(cZipDir, aFiles, nLevel, {|cF| nLidos++, oMeter:SET(nLidos), oMeter:cText := cF }, lOverWrite, cPassWord, lWithPath, lWithDrive ) id=code>id=code> Quote Link to comment Share on other sites More sharing options...
fluna Posted October 2, 2011 Author Report Share Posted October 2, 2011 Quase rone, nem sempre dá para saber o nome das pastas para entrar em cada uma e incluir no projeto, e me parece que o HBZIP tem um bug, não inclui arquivos dentro de subpastas... o jeito é partir para winexec("pkzip bla bla bla") De qualquer maneira, valeu pela ajuda, muito obrigado. xharbour 0.99.50 (simplex); fwh6.2(free),hbmake,Qedit(dos;PspPad Editor Quote Link to comment Share on other sites More sharing options...
kapiaba Posted October 3, 2011 Report Share Posted October 3, 2011 http://www.fivewin.com.br/exibedicas.asp?id=1052 João Santos - São Paulo. kmt_karinha@pop.com.br joao@pleno.com.br Fone: (11) 3106-2832 / 8243-5632 - TIM FWH 2.7 - xHARBOUR WorkShop.Exe Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.