B.63 TouchTask

The TouchTask works like the Unix touch command: It sets the modtime of a file to a specific time. Default is the current time.

Table B.66: Attributes

NameTypeDescriptionDefaultRequired
file String The file which time is to be changed.n/aYes, or nested <fileset> tag
datetime DateTime The date and time the mtime of the file is to be set to. The format is "MM/DD/YYYY HH:MM AM or PM" now No
seconds Integer The number of seconds since Midnight Jan 1 1970 (Unix epoch). now No
millis Integer The number of milliseconds since Midnight Jan 1 1970 (Unix epoch). Note: milliseconds are converted to seconds internally. When using this option the value must be greater than 1000. now No
seconds Integer The number of seconds since Midnight Jan 1 1970 (Unix epoch). now No
mkdirs Boolean Whether to create nonexistent parent directories when touching new files. false No
verbose Boolean Whether to log the creation of new files. true No

B.63.1 Examples

<touch file="README.txt" millis="102134111" />

<touch file="COPYING.lib" datetime="10/10/1999 09:31 AM" />
        
<target name="map">
    <touch file="${tmp.dir}/touchtest"/>
    <touch>
        <fileset file="${tmp.dir}/touchtest" />
        <mapper type="composite">
            <mapper type="glob" from="*" to="*foo" />
            <mapper type="glob" from="*" to="*bar" />
        </mapper>
    </touch>
</target>
        

B.63.2 Supported Nested Tags