ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <DDevie...@lgc.com>
Subject RE: file size
Date Tue, 19 Nov 2002 15:00:03 GMT
<?xml version="1.0"?>

<!-- ANT build file to test a specific feature or bug of ANT.
     Dominique Devienne <ddevienne@lgc.com>      October 2002
  -->
<project name="filesize" default="test" basedir=".">

  <target name="test">
    <!-- Sets the file.size property with the length of the
         file as named in the ant.file property -->
    <script language="javascript"><![CDATA[
      filename = self.getProject().getProperty("ant.file");
      file = new java.io.File(filename);
      self.getProject().setNewProperty("file.size", file.length());
    ]]></script>
    <echo message="current build file size is '${file.size}'" />
  </target>

</project>

-----Original Message-----
From: mm [mailto:mm@cleverlance.com] 
Sent: Tuesday, November 19, 2002 4:38 AM
To: ant-user@jakarta.apache.org
Subject: file size

hi,

is there a way how to find size in byte of specified file through some ant
task and not exec.. ?

thanks 
mirek mocek

--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message