You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

unpack.html 2.7 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Language" content="en-us">
  4. <link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
  5. <title>GUnzip/BUnzip2 Task</title>
  6. </head>
  7. <body>
  8. <h2><a name="unpack">GUnzip/BUnzip2</a></h2>
  9. <h3>Description</h3>
  10. <p>Expands a file packed using GZip or BZip2.</p>
  11. <p>If <i>dest</i> is a directory the name of the destination file is
  12. the same as <i>src</i> (with the &quot;.gz&quot; or &quot;.bz2&quot;
  13. extension removed if present). If <i>dest</i> is omitted, the parent
  14. dir of <i>src</i> is taken. The file is only expanded if the source
  15. file is newer than the destination file, or when the destination file
  16. does not exist.</p>
  17. <h3>Parameters</h3>
  18. <table border="1" cellpadding="2" cellspacing="0">
  19. <tr>
  20. <td valign="top"><b>Attribute</b></td>
  21. <td valign="top"><b>Description</b></td>
  22. <td align="center" valign="top"><b>Required</b></td>
  23. </tr>
  24. <tr>
  25. <td valign="top">src</td>
  26. <td valign="top">the file to expand.</td>
  27. <td align="center" valign="top">Yes</td>
  28. </tr>
  29. <tr>
  30. <td valign="top">dest</td>
  31. <td valign="top">the destination file or directory.</td>
  32. <td align="center" valign="top">No</td>
  33. </tr>
  34. </table>
  35. <h3>Examples</h3>
  36. <blockquote><pre>
  37. &lt;gunzip src=&quot;test.tar.gz&quot;/&gt;
  38. </pre></blockquote>
  39. <p>expands <i>test.tar.gz</i> to <i>test.tar</i></p>
  40. <blockquote><pre>
  41. &lt;bunzip2 src=&quot;test.tar.bz2&quot;/&gt;
  42. </pre></blockquote>
  43. <p>expands <i>test.tar.bz2</i> to <i>test.tar</i></p>
  44. <blockquote><pre>
  45. &lt;gunzip src=&quot;test.tar.gz&quot; dest=&quot;test2.tar&quot;/&gt;
  46. </pre></blockquote>
  47. <p>expands <i>test.tar.gz</i> to <i>test2.tar</i></p>
  48. <blockquote><pre>
  49. &lt;gunzip src=&quot;test.tar.gz&quot; dest=&quot;subdir&quot;/&gt;
  50. </pre></blockquote>
  51. <p>expands <i>test.tar.gz</i> to <i>subdir/test.tar</i> (assuming
  52. subdir is a directory).</p>
  53. <h3>Related tasks</h3>
  54. <pre>
  55. &lt;gunzip src="some-archive.gz" dest="some-dest-dir"/&gt;
  56. </pre>
  57. is identical to
  58. <pre>
  59. &lt;copy todir="some-dest-dir"&gt;
  60. &lt;gzipresource&gt;
  61. &lt;file file="some-archive.gz"/&gt;
  62. &lt;/gzipresource&gt;
  63. &lt;mapper type="glob" from="*.gz" to="*"/&gt;
  64. &lt;/copy&gt;
  65. </pre>
  66. <p>The same is also true for <code>&lt;bunzip2&gt;</code> and
  67. <code>&lt;bzip2resource&gt;</code>. <code>&lt;copy&gt;</code> offers
  68. additional features like <a
  69. href="../CoreTypes/filterchains.html">filtering files</a> on the fly,
  70. allowing a file to be mapped to multiple destinations, preserving the
  71. last modified time or a configurable file system timestamp
  72. granularity.</p>
  73. <hr>
  74. <p align="center">Copyright &copy; 2000-2001,2004-2005 The Apache Software Foundation. All rights
  75. Reserved.</p>
  76. </body>
  77. </html>