Java Mailing List Archive

http://www.ant-tasks.com/

Apache Ant Archive

» Ant Users List
» Ant Developers List
How can I capture a file 's date to a property?

How can I capture a file 's date to a property?

2007-07-24       - By cknell@(protected)
Reply:     1     2     3     4     5     6     7     8     9     10  

Thanks. That does it, but what's the story on this set of messages that are
displayed when I run the task?

Trying to override old definition of task antcallback
Trying to override old definition of task antfetch
Trying to override old definition of task assert
Trying to override old definition of task bool
Trying to override old definition of task foreach
Trying to override old definition of task if
Trying to override old definition of task limit
Trying to override old definition of task math
Trying to override old definition of task post
Trying to override old definition of task stopwatch
Trying to override old definition of task switch
Trying to override old definition of task var
Trying to override old definition of task replace
Trying to override old definition of task length
Trying to override old definition of datatype sort
--
Charles Knell
cknell@(protected) - email



-----Original Message-----
From:     Dale Anson <danson@(protected)>
Sent:     Mon, 23 Jul 2007 23:06:04 -0600
To:       Ant Users List <user@(protected)>
Subject:  Re: How can I capture a file's date to a property?

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
http://antelope.tigris.org.  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"/>
       </fileutil>
       <echo>timestamp on ant.jar is ${ant_date}</echo>
   </target>
</project>

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

Hope this helps,

Dale


cknell@(protected) 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: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)


©2008 ant-tasks.com - Jax Systems, LLC, U.S.A.