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.

tempfile.html 3.9 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <!--
  2. Licensed to the Apache Software Foundation (ASF) under one or more
  3. contributor license agreements. See the NOTICE file distributed with
  4. this work for additional information regarding copyright ownership.
  5. The ASF licenses this file to You under the Apache License, Version 2.0
  6. (the "License"); you may not use this file except in compliance with
  7. the License. You may obtain a copy of the License at
  8. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. -->
  15. <html>
  16. <head>
  17. <meta http-equiv="Content-Language" content="en-us">
  18. <link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
  19. <title>Tempfile Task</title>
  20. </head>
  21. <body>
  22. <h2>Tempfile Task</h2>
  23. <h3 id="description">Description</h3>
  24. This task sets a property to the name of a temporary file.
  25. Unlike <code>java.io.File.createTempFile</code>,
  26. this task does not actually create the temporary file, but it does guarantee that the
  27. file did not exist when the task was executed.
  28. <h3>Examples:</h3>
  29. <pre>&lt;tempfile property="temp.file"/&gt;</pre>
  30. create a temporary file
  31. <pre>&lt;tempfile property="temp.file" suffix=".xml"/&gt;</pre>
  32. create a temporary file with the <code>.xml</code> suffix
  33. <pre>&lt;tempfile property="temp.file" destDir="build"/&gt;</pre>
  34. create a temporary file in the <code>build</code> subdirectory
  35. <h3 id="attributes">Parameters</h3>
  36. <table>
  37. <tr>
  38. <td valign="top" align="left">
  39. <b>Attribute</b>
  40. </td>
  41. <td valign="top" align="left">
  42. <b>Description</b>
  43. </td>
  44. <td valign="top" align="left">
  45. <b>Type</b>
  46. </td>
  47. <td valign="top" align="left">
  48. <b>Requirement</b>
  49. </td>
  50. </tr>
  51. <tr>
  52. <td valign="top" align="left">
  53. property
  54. </td>
  55. <td valign="top" align="left">
  56. Sets the property you wish to assign the temporary file to.
  57. </td>
  58. <td valign="top" align="left">
  59. String
  60. </td>
  61. <td valign="top" align="left" rowspan="1">
  62. Required
  63. </td>
  64. </tr>
  65. <tr>
  66. <td valign="top" align="left">
  67. destdir
  68. </td>
  69. <td valign="top" align="left">
  70. Sets the destination directory. If not set, the basedir directory is used instead.
  71. </td>
  72. <td valign="top" align="left">
  73. File
  74. </td>
  75. <td valign="top" align="left" rowspan="5">
  76. Optional
  77. </td>
  78. </tr>
  79. <tr>
  80. <td valign="top" align="left">
  81. prefix
  82. </td>
  83. <td valign="top" align="left">
  84. Sets the optional prefix string for the temp file.
  85. </td>
  86. <td valign="top" align="left">
  87. String
  88. </td>
  89. </tr>
  90. <tr>
  91. <td valign="top" align="left">
  92. suffix
  93. </td>
  94. <td valign="top" align="left">
  95. Sets the optional suffix string for the temp file.
  96. </td>
  97. <td valign="top" align="left">
  98. String
  99. </td>
  100. </tr>
  101. <tr>
  102. <td valign="top" align="left">
  103. deleteonexit
  104. </td>
  105. <td valign="top" align="left">
  106. Whether the temp file will be marked for deletion on normal exit of the Java Virtual Machine (even though the file may never be created); default <em>false</em>. <em>Since Apache Ant 1.7</em>
  107. </td>
  108. <td valign="top" align="left">
  109. boolean
  110. </td>
  111. </tr>
  112. <tr>
  113. <td valign="top" align="left">
  114. createfile
  115. </td>
  116. <td valign="top" align="left">
  117. Whether the temp file should be created by this task; default <em>false</em>. <em>Since Ant 1.8</em>
  118. </td>
  119. <td valign="top" align="left">
  120. boolean
  121. </td>
  122. </tr>
  123. </table>
  124. </body>
  125. </html>