source: release-kits/lirk3/bin/ant-installer/web/manual1.6.2/manual/CoreTasks/touch.html@ 14982

Last change on this file since 14982 was 14982, checked in by oranfry, 16 years ago

initial import of LiRK3

File size: 2.7 KB
Line 
1<html>
2
3<head>
4<meta http-equiv="Content-Language" content="en-us">
5<title>Touch Task</title>
6<link rel="stylesheet" type="text/css" href="../stylesheets/antmanual.css">
7</head>
8
9<body>
10
11<h2><a name="touch">Touch</a></h2>
12<h3>Description</h3>
13<p>Changes the modification time of a file and possibly creates it at
14the same time. In addition to working with a single file, this Task
15can also work a <a href="../CoreTypes/fileset.html">Fileset</a> (which
16also includes directories).</p>
17<p>For JDK 1.1 only the creation of new files with a modification time
18of now works, all other cases will emit a warning.</p>
19<h3>Parameters</h3>
20<table border="1" cellpadding="2" cellspacing="0">
21 <tr>
22 <td valign="top"><b>Attribute</b></td>
23 <td valign="top"><b>Description</b></td>
24 <td align="center" valign="top"><b>Required</b></td>
25 </tr>
26 <tr>
27 <td valign="top">file</td>
28 <td valign="top">the name of the file</td>
29 <td valign="top" align="center">unless a nested fileset element
30 has been specified.</td>
31 </tr>
32 <tr>
33 <td valign="top">millis</td>
34 <td valign="top">specifies the new modification time of the file
35 in milliseconds since midnight Jan 1 1970</td>
36 <td valign="top" align="center">No</td>
37 </tr>
38 <tr>
39 <td valign="top">datetime</td>
40 <td valign="top">specifies the new modification time of the file
41 in the format MM/DD/YYYY HH:MM AM_or_PM or MM/DD/YYYY HH:MM:SS AM_or_PM.</td>
42 <td valign="top" align="center">No</td>
43 </tr>
44</table>
45<p>If both <code>millis</code> and <code>datetime</code> are omitted
46the current time is assumed.</p>
47<h3>Examples</h3>
48<pre> &lt;touch file=&quot;myfile&quot;/&gt;</pre>
49<p>creates <code>myfile</code> if it doesn't exist and changes the
50modification time to the current time.</p>
51<pre> &lt;touch file=&quot;myfile&quot; datetime=&quot;06/28/2000 2:02 pm&quot;/&gt;</pre>
52<p>creates <code>myfile</code> if it doesn't exist and changes the
53modification time to Jun, 28 2000 2:02 pm (14:02 for those used to 24
54hour times).</p>
55<pre> &lt;touch datetime=&quot;09/10/1974 4:30 pm&quot;&gt;
56 &lt;fileset dir=&quot;src_dir&quot;/&gt;
57 &lt;/touch&gt;</pre>
58<p>changes the modification time to Oct, 09 1974 4:30 pm of all files and directories
59 found in <code>src_dir</code>. </p>
60<pre> &lt;touch file=&quot;myfile&quot; datetime=&quot;06/28/2000 2:02:17 pm&quot;/&gt;</pre>
61<p>creates <code>myfile</code> if it doesn't exist and changes the
62modification time to Jun, 28 2000 2:02:17 pm (14:02:17 for those used to 24
63hour times), if the filesystem allows a precision of one second - a
64time close to it otherwise.</p>
65<hr>
66<p align="center">Copyright &copy; 2000-2001,2003 Apache Software Foundation. All rights
67Reserved.</p>
68
69</body>
70</html>
71
Note: See TracBrowser for help on using the repository browser.