ZIPArchive
A 4D ZIP archive is a File
or Folder
object containing one or more files or folders, which are compressed to be smaller than their original size. Esses arquivos são criados com uma extensão ".zip" e podem ser usados para poupar espaço em disco ou transferir arquivos via meios que tenham limitações de tamanho (por exemplo, um email ou por uma rede).
- You create a 4D ZIP archive with the
ZIP Create archive
command. - 4D
ZIPFile
andZIPFolder
instances are available through theroot
property (ZIPFolder
) of the object returned byZIP Read archive
command.
Exemplo
Para recuperar e ver os conteúdos de um objeto ZIP file:
var $path; $archive : 4D. File
var $zipFile : 4D. ZipFile
var $zipFolder : 4D. ZipFolder
var $txt : Text
$path:=Folder(fk desktop folder).file("MyDocs/Archive.zip")
$archive:=ZIP Read archive($path)
$zipFolder:=$archive.root // store the zip main folder
$zipFile:=$zipFolder.files()[0] //read the first zipped file If($zipFile.extension=".txt")
$txt:=$zipFile.getText()
End if
Resumo
.root : 4D.ZipFolder a virtual folder providing access to the contents of the ZIP archive |
.root
.root : 4D.ZipFolder
Descrição
The .root
property contains a virtual folder providing access to the contents of the ZIP archive.
The root
folder and its contents can be manipulated with the ZipFile and ZipFolder functions and properties.
Essa propriedade é somente leitura.