Changes

Jump to navigation Jump to search
98 bytes removed ,  19:56, 18 July 2022
no edit summary
This [[Module Library|XQuery Module]] contains functions to handle archives (including ePub, Open Office, JAR, and many other formats). New ZIP and GZIP archives can be created, existing archives can be updated, and the archive entries can be listed and extracted. The {{Function|Archive|archive:extract-binary}} function includes an example for writing the contents of an archive to disk.
=Conventions=
|-
| '''Summary'''
|Returns the options of the specified {{Code|$archive}} in the format specified by {{Function|Archive|archive:create}}.
|-
| '''Errors'''
|-
| '''Summary'''
|Extracts entries of the specified {{Code|$archive}} and returns them as texts.<br/>The returned entries can be limited via {{Code|$entries}}. The format of the argument is the same as for {{Function|Archive|archive:create}} (attributes will be ignored).<br/>The encoding of the input files can be specified via {{Code|$encoding}}.
|-
| '''Errors'''
|-
| '''Summary'''
|Extracts entries of the specified {{Code|$archive}} and returns them as binaries.<br/>The returned entries can be limited via {{Code|$entries}}. The format of the argument is the same as for {{Function|Archive|archive:create}} (attributes will be ignored).
|-
| '''Errors'''
|-
| '''Summary'''
|Creates an updated version of the specified {{Code|$archive}} with new or replaced entries.<br/>The format of {{Code|$entries}} and {{Code|$contents}} is the same as for {{Function|Archive|archive:create}}.
|-
| '''Errors'''
|-
| '''Summary'''
|Deletes entries from an {{Code|$archive}}.<br/>The format of {{Code|$entries}} is the same as for {{Function|Archive|archive:create}}.
|-
| '''Errors'''
|-
| '''Summary'''
|This convenience function creates an archive from all files in the specified directory {{Code|$path}}.<br/>The {{Code|$options}} parameter contains archiving options, and the files to be archived can be limited via {{Code|$entries}}. The format of the two last arguments is identical to {{Function|Archive|archive:create}}, but two additional options are available:
* {{Code|recursive}}: parse all files recursively (default: {{Code|true}}; ignored if entries are specified via the last argument).
* {{Code|root-dir}}: use name of supplied directory as archive root directory (default: {{Code|false}}).
|-
| '''Summary'''
|This convenience function writes files of an {{Code|$archive}} directly to the specified directory {{Code|$path}}.<br/>The archive entries to be written can be restricted via {{Code|$entries}}. The format of the argument is the same as for {{Function|Archive|archive:create}} (attributes will be ignored).
|-
| '''Errors'''
|-
|{{Code|error}}
|Archive processing failed.
|-
|{{Code|format}}
;Version 9.6
* Added: {{Function|Archive|archive:write}}
;Version 9.0
* Updated: {{Function|Archive|archive:create-from}}: options added
* Updated: error codes updated; errors now use the module namespace
;Version 8.5
* Updated: {{Function|Archive|archive:options}}: map returned instead of element
;Version 8.3
* Added: {{Function|Archive|archive:create-from}}, {{Function|Archive|archive:extract-to}} (replaces <code>archive:write</code>)
The module was introduced with Version 7.3.
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu