Histórico da Página
...
- Essa função compacta no formato gzip (GNU zip).
- Caso cSource seja uma string vazia, é gerada uma exceção com a mensagem: "Error in GzStrComp(): String is empty.".
- Caso haja um erro na compactação, é definido em cTarget uma string vazia ("") e em nTargetLen o valor 0 (zero).
...
Bloco de código | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
#include "TOTVS.ch" user function Exemplo() Local cUncomp := "", cComp := "" Local nLenComp := 0, nHandle := -1 Local cText := "" Local cTxtFile := "", cGzFile := "" Local cEnvPath := "" cText := "Teste da funcao GzStrComp." cTxtFile := "\file.txt" cGzFile := "\file.gz" nHandle := FCreate( cTxtFile ) FWrite( nHandle, cText ) FClose( nHandle ) GzStrComp( cText, @cComp, @nLenComp ) nHandle := FCreate( cGzFile ) FWrite( nHandle, cComp ) FClose( nHandle ) if isSrvUnix() cEnvPath := GetSrvProfString( "RootPath", "" ) GzDecomp( cGzFile, cEnvPath ) else GzDecomp( cGzFile, "\" ) endif GzStrDecom( cComp, nLenComp, @cUncomp ) FErase( cTxtFile ) FErase( cGzFile ) ConOut(cUncomp) // Resultado: "Teste da funcao GzStrComp." return |
Abrangência
Application Server 13.0.0.0
Veja também
Visão Geral
Import HTML Content
Conteúdo das Ferramentas
Tarefas