
Signature
Andrew Thompson
http://www.athompson.info/andrew/
> It confounds me that there seems to be no way in ant, to retrieve
> the size of a file as an integer figure of bytes.
I don't think it's a something often needed by a typical build.
> Did I miss something? Either that provides that functionality, or in
> the way ant works/is supposed to work (e.g. write a custom task).
I've never done this myself, but implementing a new task doesn't look
all that intimidating:
<taskdef name="FileSize" classname="org.whatever.FileSize"/>
Then do something simple with java.io.File.length()?
/gordon
--
Andrew Thompson - 16 Oct 2007 13:56 GMT
>> It confounds me that there seems to be no way in ant, to retrieve
>> the size of a file as an integer figure of bytes.
>
>I don't think it's a something often needed by a typical build.
I was beginning to suspect that. Daniel's pointer to
the introduction of it in 1.6.3 supports that even more,
in that it seems rather later to be introducing something
which is imperative for a good build tool.
>> Did I miss something? Either that provides that functionality, or in
>> the way ant works/is supposed to work (e.g. write a custom task).
>
>I've never done this myself, but implementing a new task doesn't look
>all that intimidating:
I had implemented a custom task for the saverbeans project.
As you suspect - it is not that tricky. But another thing I
forgot to menion was that I wanted these build files (in the
best situation) to be available to anyone running Ant (1.n.n+),
and introducing custom tasks complicates that.
I think I'll go with Daniel's suggestion and 1.6.3+.
Thanks for the input.

Signature
Andrew Thompson
http://www.athompson.info/andrew/
> I would like to add the file size to a variety of JNLP
> (XML) files that are generated by ant, as are the
[quoted text clipped - 10 lines]
> (BTW - ideally I am after an X-plat way, but for my own
> purposes, even something 'exec' for Win. XP will do..)
http://ant.apache.org/manual/CoreTasks/length.html
Since Ant 1.6.3.
Dan.

Signature
Daniel Dyer
http://www.uncommons.org
Andrew Thompson - 16 Oct 2007 13:57 GMT
(re Ant)
>> I would like to add the file size ...
..
>http://ant.apache.org/manual/CoreTasks/length.html
>
>Since Ant 1.6.3.
I'll have to upgrade, but that is just what I was after.
My build files are about to become 1.6.3+. :-)

Signature
Andrew Thompson
http://www.athompson.info/andrew/
Andrew Thompson - 16 Oct 2007 14:00 GMT
>(re Ant)
>>> I would like to add the file size ...
[quoted text clipped - 5 lines]
>I'll have to upgrade, but that is just what I was after.
>My build files are about to become 1.6.3+. :-)
Unhhh..
C:\Documents and Settings\Administrator>ant -version
Apache Ant version 1.7.0 compiled on December 13 2006
Looks like it is my *documentation* that needs 'upgrading'!

Signature
Andrew Thompson
http://www.athompson.info/andrew/