C.11 FileSizeTask

Stores the size of a specified file in a property. The file size is returned in bytes.

Table C.12: Attributes

NameTypeDescriptionDefaultRequired
fileStringFilename.n/aYes
propertynameStringName of property where the file size is stored.filesizeNo

C.11.1 Example

<filesize file="${builddir}/${tarball}.tar.${compression}" />
<php expression="floor(${filesize}/1024)" returnProperty="ksize" />
<php expression="floor(${filesize}/1024/1024)" returnProperty="msize" />
<echo msg="Filesize is: ${ksize} kB"/>
<echo msg="Filesize is: ${msize} MB"/>