Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

Archive.CompressText

Compresses a text into a new archive.

Component Version macOS Windows Linux Server iOS SDK
Archive 14.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "Archive.CompressText"; Format; Filter; Destination; Text { ; Options; Password } )   More

Parameters

Parameter Description Example Flags
Format The format to use.
Formats: ar, arbsd, argnu, arsvr4, bsdtar, cd9660, cpio, gnutar, iso, iso9660, mtree, mtree-classic, newc, odc, oldtar, pax, paxr, posix, raw, rpax, shar, shardump, ustar, v7tar, v7, warc, xar, zip.
"zip"
Filter The filter to use.
For zip format can be store or deflate.
Filters: b64encode, bzip2, compress, grzip, gzip, lrzip, lz4, lzip, lzma, lzop, uuencode, xz, zstd.

Not all filters can be combined with all formats.
"deflate"
Destination The native file path to the destination archive.
Or file name for container.
"C:\test.zip"
Text The text to compress.
We use UTF-8 encoding.
"Hello World"
Options The options to pass to writer.
This is a comma-separated list of options. Option names can be prefixed with module name.

Sample options:
compression-level=9
zip:encryption=zipcrypt
zip:encryption=aes128
zip:encryption=aes256
zip64
gzip:compression-level=9
hdrcharset=UTF-8
"zip:encryption=zipcrypt" Optional
Password The passphrase to use for password protection. "secret" Optional

Result

Returns container or error.

Description

Compresses a text into a new archive.
Supports various compression algorithms and encryption.

See also

Release notes

  • Version 14.3
    • Added Archive.CompressText function.

Blog Entries

This function checks for a license.

Created 9th June 2024, last changed 13th June 2024


Archive.CompressContainer - Archive.Content