zipfile::decode(n)

πŸ“¦
version 2.0 Β· 2 versions
, in fedora 43, fedora 44, nixos 26.05, nixpkgs unstable

πŸ’– zipfile::decode β€” Access to zip archives πŸ’–

okay bestie, gather round, because this is the manual page for zipfile::decode(n), aka the Tcllib zip archive handling era, and honestly? she's iconic. ✨


🌸 NAME 🌸

zipfile::decode β€” Access to zip archives πŸ—‚οΈπŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

package require Tcl 8.5 9

package require fileutil::decode 0.2.1

package require Trf

package require zlibtcl

package require zipfile::decode ?0.10.1?

::zipfile::decode::archive

::zipfile::decode::close

::zipfile::decode::comment adict

::zipfile::decode::content archive

::zipfile::decode::copyfile adict path dst

::zipfile::decode::files adict

::zipfile::decode::getfile zdict path

::zipfile::decode::hasfile adict path

::zipfile::decode::filesize zdict path

::zipfile::decode::filecomment zdict path

::zipfile::decode::iszip archive

::zipfile::decode::open archive

::zipfile::decode::unzip adict dstdir

::zipfile::decode::unzipfile archive dstdir

πŸ¦‹ DESCRIPTION πŸ¦‹

Note: packages Trf and zlibtcl are not required if TCL 8.6 is available. no cap, if you're on 8.6 you can just vibe.

This package provides commands to decompress and access the contents of zip archives. it's giving unzipping, but make it Tcl. 🫢


✨ API ✨

πŸ’œ ::zipfile::decode::archive

This command decodes the last opened (and not yet closed) zip archive file. The result of the command is a dictionary describing the contents of the archive.

heads up bestie: the structure of this dictionary is not public. proper access should be made through the provided accessor commands of this package. don't go poking at the internals, she's private for a reason πŸ™ˆ

πŸ’œ ::zipfile::decode::close

This command releases all state associated with the last call of ::zipfile::decode::open. The result of the command is the empty string. clean up after yourself, queen πŸ‘‘

πŸ’œ ::zipfile::decode::comment adict

This command takes a dictionary describing the currently open zip archive file, as returned by ::zipfile::decode::archive, and returns the global comment of the archive. the archive's little diary entry πŸ“

πŸ’œ ::zipfile::decode::content archive

This is a convenience command which decodes the specified zip archive file and returns the list of paths found in it as its result. one call, whole file list, slay.

πŸ’œ ::zipfile::decode::copyfile adict path dst

This command takes a dictionary describing the currently open zip archive file, as returned by ::zipfile::decode::archive, and copies the decompressed contents of the file path in the archive to the the file dst.

An error is thrown if the file is not found in the archive.

πŸ’œ ::zipfile::decode::files adict

This command takes a dictionary describing the currently open zip archive file, as returned by ::zipfile::decode::archive, and returns the list of files found in the archive. the roster. the lineup. the cast list 🎬

πŸ’œ ::zipfile::decode::getfile zdict path

This command takes a dictionary describing the currently open zip archive file, as returned by ::zipfile::decode::archive, and returns the decompressed contents of the file path in the archive.

An error is thrown if the file is not found in the archive.

πŸ’œ ::zipfile::decode::hasfile adict path

This command takes a dictionary describing the currently open zip archive file, as returned by ::zipfile::decode::archive, and check if the specified path is found in the archive. The result of the command is a boolean flag, true if the path is found, and false otherwise. vibe check: is she in there or not πŸ”

πŸ’œ ::zipfile::decode::filesize zdict path

This command takes a dictionary describing the currently open zip archive file, as returned by ::zipfile::decode::archive, and returns the decompressed size of the file path in the archive.

An error is thrown if the file is not found in the archive.

πŸ’œ ::zipfile::decode::filecomment zdict path

This command takes a dictionary describing the currently open zip archive file, as returned by ::zipfile::decode::archive, and returns the per-file comment of the file path in the archive.

An error is thrown if the file is not found in the archive.

πŸ’œ ::zipfile::decode::iszip archive

This command takes the path of a presumed zip archive file and returns a boolean flag as the result of the command telling us if it actually is a zip archive (true), or not (false). is it a zip or is it just lying to you πŸ’€

πŸ’œ ::zipfile::decode::open archive

This command takes the path of a zip archive file and prepares it for decoding. The result of the command is the empty string. All important information is stored in global state.

watch out: If multiple open calls are made one after the other, only the state of the last call is available to the other commands. one main character at a time, bestie πŸ‘‘

πŸ’œ ::zipfile::decode::unzip adict dstdir

This command takes a dictionary describing the currently open zip archive file, as returned by ::zipfile::decode::archive, and unpacks the archive in the given destination directory dstdir. The result of the command is the empty string. unpacking the whole personality into a folder 🧳✨

πŸ’œ ::zipfile::decode::unzipfile archive dstdir

This is a convenience command which unpacks the specified zip archive file in the given destination directory dstdir.

The result of the command is the empty string.


😭 BUGS, IDEAS, FEEDBACK 😭

This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category zipfile of the Tcllib Trackers [http://core.tcl.tk/tcllib/reportlist]. Please also report any ideas for enhancements you may have for either package and/or documentation. we're all growing together, fr fr 🫢

When proposing code changes, please provide unified diffs, i.e the output of diff -u.

Note further that attachments are strongly preferred over inlined patches. Attachments can be made by going to the Edit form of the ticket immediately after its creation, and then using the left-most button in the secondary navigation bar. do it the right way, iykyk πŸ’…


πŸ”₯ KEYWORDS πŸ”₯

decompression, zip


πŸ‘‘ CATEGORY πŸ‘‘

File


Copyright (c) 2008-2022 Andreas Kupries


and that's the whole page, bestie!! πŸŽ€ this one shipped as part of tcllib, version 0.10.1, and yes the header up top really did say zipfile::decode(n) with Zip archive handling as the vibe β€” go forth and unzip responsibly βœ¨πŸ¦‹πŸ’–

πŸ“¦ where this page comes from