ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dale Anson <>
Subject Re: How can I capture a file's date to a property?
Date Tue, 24 Jul 2007 05:06:04 GMT
Hi Charles,

There seems to be an issue with the antelope.taskdef file for a few 
tasks.  Try using the antlib.xml instead.  The example below works fine 
for me using the current AntelopeTasks_3.4.2.jar from  I tested this on both Ant 1.6.5 and 1.7.0. 

<project name="fileutil_test" basedir="." default="test">

    <taskdef resource="ise/antelope/tasks/antlib.xml"/>

    <target name="test">
        <property name="ant.jar" value="${ant.library.dir}/ant.jar"/>
        <fileutil file="${ant.jar}" property="ant_date">
            <lastmodified format="yyyy-MM-dd"/>
        <echo>timestamp on ant.jar is ${ant_date}</echo>

I did notice that on your date format, I think you wanted MM rather than mm.

Hope this helps,

Dale wrote:
> There are a number of problems with the example task:
> <fileutil file="foobar.txt" property="moddate">
>    <lastmodified format="...">
>  </fileutils>
> - The opening and closing tag names do not match ("fileutil" vs. "fileutils").
> - The <lastmodified> tag is not closed.
> Even after correcting for these, I get an error message from ant when I run the target:
> ------------------------------------------------------------------------------------------
> <taskdef resource="ise/antelope/tasks/antelope.taskdefs"/>
> <target name="test">
>   <fileutil file="build.xml" property="date.last.modified">
>     <lastmodified format="yyyy-mm-dd" />
>   </fileutil>
>   <echo>${date.last.modified}</echo>
> </target>
> ts.xml:6: No public execute() in class ise.antelope.tasks.typedefs.file.FileLength
> ------------------------------------------------------------------------------------------
> I have dowloaded and installed AntelopeTasks_3.4.2.jar in the lib directory of my 
> %ANT__HOME% directory.
> Can anyone offer a useful analysis of the error message and suggest a fix?
> Thanks.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message