2018-12-21 11:20:43 +01:00
|
|
|
<!DOCTYPE html>
|
2006-09-11 04:19:00 +00:00
|
|
|
<!--
|
|
|
|
Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
contributor license agreements. See the NOTICE file distributed with
|
|
|
|
this work for additional information regarding copyright ownership.
|
|
|
|
The ASF licenses this file to You under the Apache License, Version 2.0
|
|
|
|
(the "License"); you may not use this file except in compliance with
|
|
|
|
the License. You may obtain a copy of the License at
|
|
|
|
|
2019-05-25 13:41:47 +02:00
|
|
|
https://www.apache.org/licenses/LICENSE-2.0
|
2006-09-11 04:19:00 +00:00
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
-->
|
2018-01-22 09:10:26 +01:00
|
|
|
|
2018-12-21 11:20:43 +01:00
|
|
|
<html lang="en">
|
2002-06-01 12:26:43 +00:00
|
|
|
<head>
|
2018-01-22 09:10:26 +01:00
|
|
|
<link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
|
2015-06-10 08:48:33 +02:00
|
|
|
<title>Tempfile Task</title>
|
2002-06-01 12:26:43 +00:00
|
|
|
</head>
|
|
|
|
|
2018-01-22 09:10:26 +01:00
|
|
|
<body>
|
|
|
|
<h2>Tempfile Task</h2>
|
|
|
|
<h3 id="description">Description</h3>
|
2018-02-28 07:58:59 +01:00
|
|
|
<p>This task sets a property to the name of a temporary file.
|
2018-03-10 20:17:33 +01:00
|
|
|
Unlike <code class="code">java.io.File.createTempFile</code>, this task does not actually create the
|
|
|
|
temporary file, but it does guarantee that the file did not exist when the task was executed.</p>
|
2018-01-22 09:10:26 +01:00
|
|
|
<h3 id="attributes">Parameters</h3>
|
2018-02-28 07:58:59 +01:00
|
|
|
<table class="attr">
|
2018-01-22 09:10:26 +01:00
|
|
|
<tr>
|
2018-05-15 10:29:27 +02:00
|
|
|
<th scope="col">Attribute</th>
|
|
|
|
<th scope="col">Description</th>
|
|
|
|
<th scope="col">Type</th>
|
|
|
|
<th scope="col">Required</th>
|
2018-01-22 09:10:26 +01:00
|
|
|
</tr>
|
|
|
|
<tr>
|
2018-02-28 07:58:59 +01:00
|
|
|
<td>property</td>
|
|
|
|
<td>Sets the property you wish to assign the temporary file to.</td>
|
|
|
|
<td>String</td>
|
|
|
|
<td>Yes</td>
|
2018-01-22 09:10:26 +01:00
|
|
|
</tr>
|
|
|
|
<tr>
|
2018-02-28 07:58:59 +01:00
|
|
|
<td>destdir</td>
|
|
|
|
<td>Sets the destination directory.</td>
|
|
|
|
<td>File</td>
|
|
|
|
<td>No; defaults to <var>basedir</var></td>
|
2018-01-22 09:10:26 +01:00
|
|
|
</tr>
|
|
|
|
<tr>
|
2018-02-28 07:58:59 +01:00
|
|
|
<td>prefix</td>
|
|
|
|
<td>Sets the optional prefix string for the temp file.</td>
|
|
|
|
<td>String</td>
|
|
|
|
<td>No</td>
|
2018-01-22 09:10:26 +01:00
|
|
|
</tr>
|
|
|
|
<tr>
|
2018-02-28 07:58:59 +01:00
|
|
|
<td>suffix</td>
|
|
|
|
<td>Sets the optional suffix string for the temp file.</td>
|
|
|
|
<td>String</td>
|
|
|
|
<td>No</td>
|
2018-01-22 09:10:26 +01:00
|
|
|
</tr>
|
|
|
|
<tr>
|
2018-02-28 07:58:59 +01:00
|
|
|
<td>deleteonexit</td>
|
|
|
|
<td>Whether the temp file will be marked for deletion on normal exit of JVM (even though the
|
|
|
|
file may never be created). <em>Since Apache Ant 1.7</em></td>
|
|
|
|
<td>boolean</td>
|
|
|
|
<td>No; defaults to <q>false</q></td>
|
2018-01-22 09:10:26 +01:00
|
|
|
</tr>
|
|
|
|
<tr>
|
2018-02-28 07:58:59 +01:00
|
|
|
<td>createfile</td>
|
|
|
|
<td>Whether the temp file should be created by this task. <em>Since Ant 1.8</em></td>
|
|
|
|
<td>boolean</td>
|
|
|
|
<td>No; defaults to <q>false</q></td>
|
2002-06-01 12:26:43 +00:00
|
|
|
</tr>
|
|
|
|
</table>
|
2018-05-15 09:51:58 +02:00
|
|
|
|
2018-02-28 07:58:59 +01:00
|
|
|
<h3>Examples</h3>
|
2018-05-15 09:51:58 +02:00
|
|
|
<p>Create a temporary file</p>
|
2018-02-28 07:58:59 +01:00
|
|
|
<pre><tempfile property="temp.file"/></pre>
|
|
|
|
|
2018-05-15 09:51:58 +02:00
|
|
|
<p>Create a temporary file with the <code>.xml</code> suffix</p>
|
2018-02-28 07:58:59 +01:00
|
|
|
<pre><tempfile property="temp.file" suffix=".xml"/></pre>
|
|
|
|
|
2018-05-15 09:51:58 +02:00
|
|
|
<p>Create a temporary file in the <code>build</code> subdirectory</p>
|
2018-02-28 07:58:59 +01:00
|
|
|
<pre><tempfile property="temp.file" destDir="build"/></pre>
|
2002-06-01 12:26:43 +00:00
|
|
|
</body>
|
|
|
|
</html>
|