Atom

ZIP archive handling

Save as zip-note.atom. Requires archive support. It serializes an archive to a temporary file, lists the entries and reads the selected content.

zip-note.atom
use archive
use binary
use fs

file = fs.temporary_file()
try:
    write(file, archive.zip({['notes/readme.txt'] = 'Saved from Atom'}))
    zipped = read(file, 'rb')
    for name, size in archive.list(zipped):
        print(name, size)
    documents = archive.unzip(zipped, 1024)
    print(binary.text(documents['notes/readme.txt']))
finally:
    fs.remove(file)