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.

delete.html 4.2 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Language" content="en-us">
  4. <title>Ant User Manual</title>
  5. </head>
  6. <body>
  7. <h2><a name="delete">Delete</a></h2>
  8. <h3>Description</h3>
  9. <p>Deletes either a single file, all files in a specified directory and its
  10. sub-directories, or a set of files specified by one or more <a href="../CoreTypes/fileset.html">FileSet</a>s.
  11. When specifying a set of files, empty directories are <i>not</i> removed by default.
  12. To remove empty directories, use the <em>includeEmptyDirs</em> atribute.</p>
  13. <h3>Parameters</h3>
  14. <table border="1" cellpadding="2" cellspacing="0">
  15. <tr>
  16. <td valign="top"><b>Attribute</b></td>
  17. <td valign="top"><b>Description</b></td>
  18. <td align="center" valign="top"><b>Required</b></td>
  19. </tr>
  20. <tr>
  21. <td valign="top">file</td>
  22. <td valign="top">The file to delete.</td>
  23. <td align="center" valign="middle" rowspan="2">at least one of the two</td>
  24. </tr>
  25. <tr>
  26. <td valign="top">dir</td>
  27. <td valign="top">The directory to delete files from.</td>
  28. </tr>
  29. <tr>
  30. <td valign="top">verbose</td>
  31. <td valign="top">Show name of each deleted file (&quot;true&quot;/&quot;false&quot;).
  32. Default is &quot;false&quot; when omitted.</td>
  33. <td align="center" valign="top">No</td>
  34. </tr>
  35. <tr>
  36. <td valign="top">quiet</td>
  37. <td valign="top">If the file does not exist, do not display a diagnostic
  38. message or modify the exit status to reflect an error (unless Ant
  39. has been invoked with the -verbose or -debug switches).
  40. This means that if a file or directory cannot be deleted,
  41. then no error is reported. This setting emulates the
  42. -f option to the Unix &quot;rm&quot; command.
  43. (&quot;true&quot;/&quot;false&quot;).
  44. Default is &quot;false&quot; meaning things are &quot;noisy&quot;.</td>
  45. <td align="center" valign="top">No</td>
  46. </tr>
  47. <tr>
  48. <td valign="top">includeEmptyDirs</td>
  49. <td valign="top">Set to &quot;true&quot; to delete empty directories when
  50. using filesets. Default is &quot;false&quot;.</td>
  51. <td align="center" valign="top">No</td>
  52. </tr>
  53. <tr>
  54. <td valign="top">includes</td>
  55. <td valign="top"><i>Deprecated.</i> Comma separated list of patterns of files that must be
  56. deleted. All files are in the current directory
  57. and any sub-directories are deleted when omitted.</td>
  58. <td valign="top" align="center">No</td>
  59. </tr>
  60. <tr>
  61. <td valign="top">includesfile</td>
  62. <td valign="top"><i>Deprecated.</i> The name of a file. Each line of this file is
  63. taken to be an include pattern</td>
  64. <td valign="top" align="center">No</td>
  65. </tr>
  66. <tr>
  67. <td valign="top">excludes</td>
  68. <td valign="top"><i>Deprecated.</i> Comma separated list of patterns of files that must be
  69. excluded from the deletion list. No files (except default excludes) are excluded when omitted.</td>
  70. <td valign="top" align="center">No</td>
  71. </tr>
  72. <tr>
  73. <td valign="top">excludesfile</td>
  74. <td valign="top"><i>Deprecated.</i> The name of a file. Each line of this file is
  75. taken to be an exclude pattern</td>
  76. <td valign="top" align="center">No</td>
  77. </tr>
  78. <tr>
  79. <td valign="top">defaultexcludes</td>
  80. <td valign="top"><i>Deprecated.</i> Indicates whether default excludes should be used or not
  81. (&quot;yes&quot;/&quot;no&quot;). Default excludes are used when omitted.</td>
  82. <td valign="top" align="center">No</td>
  83. </tr>
  84. </table>
  85. <h3>Examples</h3>
  86. <pre> &lt;delete file=&quot;/lib/ant.jar&quot;/&gt;</pre>
  87. <p>deletes the file <code>/lib/ant.jar</code>.</p>
  88. <pre> &lt;delete dir=&quot;lib&quot;/&gt;</pre>
  89. <p>deletes the <code>lib</code> directory, including all files
  90. and subdirectories of <code>lib</code>.</p>
  91. <pre> &lt;delete&gt;
  92. &lt;fileset dir=&quot;.&quot; includes=&quot;**/*.bak&quot;/&gt;
  93. &lt;/delete&gt;
  94. </pre>
  95. <p>deletes all files with the extension &quot;<code>.bak</code>&quot from the current directory
  96. and any sub-directories.</p>
  97. <pre> &lt;delete includeEmptyDirs=&quot;true&quot; &gt;
  98. &lt;fileset dir=&quot;build&quot; /&gt;
  99. &lt;/delete&gt;
  100. </pre>
  101. <p>deletes all files and subdirectories of <code>build</code>, but not
  102. <code>build</code> itself.</p>
  103. <hr><p align="center">Copyright &copy; 2000,2001 Apache Software Foundation. All rights
  104. Reserved.</p>
  105. </body>
  106. </html>