Hola Harpo.
Yo hice esta función para comprimir directorios:
Código:
'' <b>RAD Extension.</b><br>
'' Compresses all the files in a directory into a single zip file. At the moment it works properly only with the zip option
Static Public Function DirZip(sDir As String) As String
Dim sFile As String
Dim cmd As String
Dim uDir As String
Dim cDir As String
uDir = File.ParentDir(sDir)
cDir = Split(sDir, "/")[Split(sDir, "/").Max]
sFile = sDir & ".zip"
cmd = "cd '" & sDir & "';zip -jr '" & sFile & "' *.*"
If cmd <> "" Then
Shell cmd Wait
Endif
If Exist(sFile) Then
Return sFile
Else
Return ""
Endif
End
Espero que te sirva. Por supuesto hay que tener instalado el paquete zip en el sistema.
Luego esta otra tiene por finalidad leer un texto que se encuentra alojado dentro de un contendor zip
Código:
'' <b>RAD Extension.</b><br>
'' Read a text file inside a zip.
'' strZip is the full path of the zip file
'' strFile is the relative path of the txt file inside the zip
Static Public Function ReadZip(sZip As String, sFile As String) As String
Dim sData As String
If Exist(sZip) = True Then
Shell "unzip -p '" & sZip & "' " & sFile & " 2>&1" To sData
Endif
Return sData
End