# Tar Archive Lister

Paste a tar or tar.gz archive as base64 or hex and list every member — path, size, permission mode, owner, group, type and mtime — without unpacking a single file.

## Run it

- **CLI:** `gizza tool tar-archive-lister "H4sIAAAAAAAAA+2VsQrCMBRFO/sVBfealybNLLSji39QmhaLqYG2op9vEhG1Q0Ux6ZCcJRAe5MJ994bXndxEdkEKRqk+gVH0ej6IgGRACAAm6h5ATUQxtazLcB7GsldSStFW9cycGmsaF4LcwrX/+2Kb74qk43be0AZnhMz4zyb+Y6zWJUZ25Lzjuf/rOFcbsFpaRmAhTP65rAaLn8AP/c/S0P9OePp/qIWQyXgd//7Gx/4HMvE/pQyF/neBcT2+yF7w8Al4iMm/aE9HK8m/Y/qfsS/6n2Kdf2y5lwye5z8QCPjLDVPttHEAEgAA"`
- **Web:** https://gizza.ai/tools/tar-archive-lister/
- **Agents:** machine-readable descriptor (parameters JSON Schema) at https://gizza.ai/tools/tar-archive-lister/tool.json

## Inputs

- `input` — Archive bytes (base64 or hex) _(field)_
- `input_format` — Input encoding _(field)_
- `output` — Output format _(field)_
- `sort` — Sort members by _(field)_
- `filter` — Path filter (glob or substring) _(field)_
- `include_dirs` — Include directory members _(field)_
- `time_format` — Timestamp format _(field)_
- `limit` — Max members to list _(field)_

## Output

- Archive members (text)

## Query parameters

Open the tool pre-filled and auto-run via URL:

- `input` — Archive bytes (base64 or hex)
- `input_format` — Input encoding
- `output` — Output format
- `sort` — Sort members by
- `filter` — Path filter (glob or substring)
- `include_dirs` — Include directory members
- `time_format` — Timestamp format
- `limit` — Max members to list

Example: `https://gizza.ai/tools/tar-archive-lister/?input=H4sIAAAAAAAAA%2B2VsQrCMBRFO%2FsVBfealybNLLSji39QmhaLqYG2op9vEhG1Q0Ux6ZCcJRAe5MJ994bXndxEdkEKRqk%2BgVH0ej6IgGRACAAm6h5ATUQxtazLcB7GsldSStFW9cycGmsaF4LcwrX%2F%2B2Kb74qk43be0AZnhMz4zyb%2BY6zWJUZ25Lzjuf%2FrOFcbsFpaRmAhTP65rAaLn8AP%2Fc%2FS0P9OePp%2FqIWQyXgd%2F%2F7Gx%2F4HMvE%2FpQyF%2FneBcT2%2ByF7w8Al4iMm%2FaE9HK8m%2FY%2FqfsS%2F6n2Kdf2y5lwye5z8QCPjLDVPttHEAEgAA&input_format=base64&output=table&sort=archive&filter=%2A.txt&include_dirs=true&time_format=iso&limit=500`

---

## About this tool

A tarball is just a sequence of 512-byte headers plus file payload blocks. This tool walks
those headers and prints the archive table of contents — paths, byte sizes, permission bits,
owners, groups, entry types, modification times and link targets — without extracting any
member data to disk.

Paste a base64 or hex encoded `.tar`, `.tar.gz` or `.tgz` archive, then choose whether you
want a human `tar -tvf` style table, one path per line, CSV, or structured JSON. Everything
runs locally in your browser; the archive bytes are not uploaded.

### Worked example

The built-in sample is a small gzip-compressed tar with directories, text files and a
symlink. With the default **table** output, the result looks like a traditional long listing:

```text
drwxr-xr-x alice/staff  0 2024-05-01 10:00:00 demo/
-rw-r--r-- alice/staff  7 2024-05-01 10:00:00 demo/README.md
drwxr-xr-x alice/staff  0 2024-05-01 10:00:00 demo/docs/
-rw-r--r-- alice/staff 12 2024-05-01 10:00:00 demo/docs/hello.txt
lrwxrwxrwx alice/staff  0 2024-05-01 10:00:00 demo/link.txt -> docs/hello.txt

5 of 5 member(s) listed (2 file(s), 2 director(y/ies), 1 other) — 19 byte(s) of content in a 4608 tar.gz stream
```

Switch **Output format** to `paths` when you only need names, `csv` for a spreadsheet, or
`json` for automation that needs offsets, numeric mode fields and archive totals.

### What it understands

- Plain `.tar` plus gzip-wrapped `.tar.gz` / `.tgz` streams.
- v7, ustar, GNU long-name / long-link headers and PAX extended headers.
- Regular files, directories, symlinks, hardlinks, device nodes, FIFOs and unknown types.
- Base64 (standard or URL-safe, with optional padding) and hex input.
- Path filters: `*.txt` and `src/*` are glob patterns; `README` is a substring match.

### Limits

Decoded and decompressed input is capped at **64 MiB**, with at most **200,000** members
parsed. The page default lists the first **500** matches; raise `limit` when you intentionally
want a longer listing. bzip2, xz and zstd tarballs are detected and rejected with a clear
message — decompress those first, then list the plain tar.

## FAQ

<details>
<summary>Does this unpack files from the archive?</summary>

No. The parser reads tar headers and skips over each payload block. It reports metadata such
as path, type, size and mode, but it never writes archive members to the browser filesystem or
to your disk.

</details>

<details>
<summary>Can it list `.tar.gz` and `.tgz` files?</summary>

Yes. gzip is detected from the magic bytes, so the same `input_format = base64` works for
plain `.tar` and gzip-wrapped `.tar.gz` / `.tgz` data. Other compressors such as bzip2, xz
and zstd are not decompressed here; decompress them first and paste the resulting tar.

</details>

<details>
<summary>What is the difference between `output = table`, `paths`, `csv` and `json`?</summary>

`table` is a human long listing similar to `tar -tvf`. `paths` emits only member names, one
per line. `csv` includes one row per member with fields such as mode, owner, mtime and offset.
`json` adds archive-level totals plus a structured object for every listed entry.

</details>

<details>
<summary>How do filters work?</summary>

A filter containing `*` or `?` is matched as a glob against the whole member path. For
example, `*.txt` matches text files anywhere in the archive and `src/*` matches members under
`src/`. A filter without wildcards is a plain substring search.

</details>

<details>
<summary>Why does the tool ask for base64 or hex instead of a file upload?</summary>

This repository's pure-WASM page surface uses text parameters shared with the CLI and chat
schema. Base64 and hex make the same deterministic engine work on the web page, in `gizza
tool`, and inside the block runtime without adding a separate file-upload API.

</details>

## Related tools

- [Article to EPUB](https://gizza.ai/tools/article-to-epub/): Turn article text or cleaned HTML into a valid EPUB 3 ebook with metadata, chapter splits, and a real table of contents. Runs in your browser.
- [Preview a Bulk File Rename](https://gizza.ai/tools/bulk-file-renamer/): Preview old-to-new filename mappings with find/replace, regex, numbering, case conversion, prefix/suffix, and collision warnings.
- [Citation Generator](https://gizza.ai/tools/citation-generator/): Free APA 7, MLA 9, Chicago and Harvard citation generator — format author, title, year, journal and URL into a correct reference right in your browser.
- [Config Merge Tool](https://gizza.ai/tools/config-merge/): Merge layered JSON, YAML, TOML and .env configuration files with override precedence, array strategy, null deletion and variable substitution.
- [Disk Usage by File Type](https://gizza.ai/tools/disk-usage-by-filetype/): Paste du, find or ls output and get a sorted bar chart of disk usage by file extension or category, with size, share and file count — free and private in your browser.
