$GunZip: Difference between revisions
m (1 revision) |
mNo edit summary |
||
Line 2: | Line 2: | ||
<span class="pageSubtitle"><section begin="desc" />Decompress a longstring with GUNZIP<section end="desc" /></span> | <span class="pageSubtitle"><section begin="desc" />Decompress a longstring with GUNZIP<section end="desc" /></span> | ||
<p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $GunZip function is [[ | <p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $GunZip function is [[GUnZip (String function)]].</p> | ||
This function extracts information from a GZIP-format longstring. | This function extracts information from a GZIP-format longstring. | ||
Line 15: | Line 13: | ||
</p> | </p> | ||
<p class="caption">%lstrc is the returned longstring.</p> | <p class="caption">%lstrc is the returned longstring.</p> | ||
The first argument, the longstring to be decompressed, is required. The string must be in GZIP format. | The first argument, the longstring to be decompressed, is required. The string must be in GZIP format. | ||
The second argument is a string indicating what information should be extracted from the GZIP-format longstring. This argument is optional; if it is not specified, <tt>DATA</tt> is assumed, and the longstring is decompressed into the result longstring. Valid options and their meanings are: | The second argument is a string indicating what information should be extracted from the GZIP-format longstring. This argument is optional; if it is not specified, <tt>DATA</tt> is assumed, and the longstring is decompressed into the result longstring. Valid options and their meanings are: | ||
===Options=== | |||
<table class="syntaxTable"> | <table class="syntaxTable"> | ||
<tr><th>DATA</th> | <tr><th>DATA</th> | ||
<td>Indicates that the data in the GZIP longstring is extracted. This is the default.</td></tr> | <td>Indicates that the data in the GZIP longstring is extracted. This is the default.</td></tr> | ||
<tr><th>TIME</th> | <tr><th>TIME</th> | ||
<td>Indicates that the date and time, known as the "modification time," is returned (in the form <tt>YYYY-MM-DD HH:MI:SS | <td>Indicates that the date and time, known as the "modification time," is returned (in the form <tt>YYYY-MM-DD HH:MI:SS</tt>).</td></tr> | ||
<tr><th>NAME</th> | <tr><th>NAME</th> | ||
<td>Indicates that the internal name of the GZIP entity is returned in the result. If no internal name is present, the null string is returned. | <td>Indicates that the internal name of the GZIP entity is returned in the result. If no internal name is present, the null string is returned. | ||
</td></tr></table> | </td></tr> | ||
Usage notes | </table> | ||
==Usage notes== | |||
<ul> | <ul> | ||
<li> If an invalid option is passed, or if compression is not enabled for the current run, the request is cancelled. | <li> If an invalid option is passed, or if compression is not enabled for the current run, the request is cancelled. | ||
<li> The NCMPBUF parameter must be set by User 0 before the $GZip function can be used. If $GunZip is called with NCMPBUF = 0, the request is cancelled. | <li> The NCMPBUF parameter must be set by User 0 before the $GZip function can be used. If $GunZip is called with NCMPBUF = 0, the request is cancelled. | ||
</ul> | </ul> | ||
==Examples== | |||
In the following example, | |||
<tt>.%ls</tt> is set to the uncompressed version of the given string The <tt>DATA</tt> value default is implied, since no second argument is given. | |||
<p class="code"> %ls = $GunZip(%lsgz) | <p class="code"> %ls = $GunZip(%lsgz) | ||
</p> | </p> | ||
In the following example, | |||
<tt>%dt</tt> is set to the last modification date and time of the file contained in the GZIP longstring. | |||
< | |||
<p class="code"> %dt = $GunZip(%lsgz, 'TIME') | <p class="code"> %dt = $GunZip(%lsgz, 'TIME') | ||
</p> | </p> | ||
''Note: GZIP-format files can be created with the function [[$GZip]] as well as other file compression utilities.'' | |||
<ul class="smallAndTightList"> | <ul class="smallAndTightList"> | ||
<li>[[Sirius functions]]</li> | <li>[[Sirius functions]]</li> | ||
Line 62: | Line 66: | ||
<p class="caption">Products authorizing $GunZip | <p class="caption">Products authorizing $GunZip | ||
</p> | </p> | ||
[[Category:$Functions|$GunZip]] | [[Category:$Functions|$GunZip]] |
Revision as of 17:47, 1 February 2011
<section begin="desc" />Decompress a longstring with GUNZIP<section end="desc" />
Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $GunZip function is GUnZip (String function).
This function extracts information from a GZIP-format longstring.
The $GunZip function accepts two arguments and returns a longstring result.
Syntax
<section begin="syntax" /> %lstrc = $GunZip(%lstr, type) <section end="syntax" />
The first argument, the longstring to be decompressed, is required. The string must be in GZIP format.
The second argument is a string indicating what information should be extracted from the GZIP-format longstring. This argument is optional; if it is not specified, DATA is assumed, and the longstring is decompressed into the result longstring. Valid options and their meanings are:
Options
DATA | Indicates that the data in the GZIP longstring is extracted. This is the default. |
---|---|
TIME | Indicates that the date and time, known as the "modification time," is returned (in the form YYYY-MM-DD HH:MI:SS). |
NAME | Indicates that the internal name of the GZIP entity is returned in the result. If no internal name is present, the null string is returned. |
Usage notes
- If an invalid option is passed, or if compression is not enabled for the current run, the request is cancelled.
- The NCMPBUF parameter must be set by User 0 before the $GZip function can be used. If $GunZip is called with NCMPBUF = 0, the request is cancelled.
Examples
In the following example, .%ls is set to the uncompressed version of the given string The DATA value default is implied, since no second argument is given.
%ls = $GunZip(%lsgz)
In the following example,
%dt is set to the last modification date and time of the file contained in the GZIP longstring.
%dt = $GunZip(%lsgz, 'TIME')
Note: GZIP-format files can be created with the function $GZip as well as other file compression utilities.