examples: short headers

This commit is contained in:
4DBug committed 2026-11-01 01:49:44 -05:00
1 parent 2591255694
commit e23adf2a2d
13 files changed
+16 -36

No files matched your search

+1 -3
View File
@@ -1,5 +1,4 @@
-- examples/archive.luau: builds a zip, lists and reads it, edits it, converts it to a .tar.gz and back, and gzips a
-- single file. Run from the repository root: luau examples/archive.luau (docs/guide/archive.md explains the API).
-- examples/archive.luau: build, read and edit a zip, convert it to .tar.gz and back, gzip a file (docs/guide/archive.md).
local F = require("@rosetta")
-- a new zip: a directory, a text file, an incompressible file stored as is
@@ -16,7 +15,6 @@ zip:add("game/noise.bin", noise, { method = "store" })
local zipBytes = assert(F.save(zip, nil, { format = "zip", comment = "example" }))
print(string.format("zip: %d bytes", buffer.len(zipBytes)))
-- list and read
local loaded = assert(F.archive.load(zipBytes))
for _, e in loaded:list() do
print(string.format(" %-18s %6d -> %6s %s", e.name, e.size, tostring(e.compressedSize), e.method or (if e.dir then "dir" else "")))