C.11 FileSizeTask
Prev | Appendix C. Optional tasks | Next

## C.11 FileSizeTask

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

Table C.12: Attributes

Name | Type | Description | Default | Required
--- | --- | --- | --- | ---
`file` | `String` | Filename | n/a | Yes
`propertyname` | `String` | Name of property where the file size is stored | filesize | No

### 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"/>

Prev | Up | Next
C.10 FileHashTask | Home | C.12 FileSyncTask