Stores the size of a specified file in a property. The file size can be returned in different units.
Table C.11: 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 |
unit | String |
File size unit. Must be one of the following:
| B | No |
<filesize file="./backup.zip"/> <echo>Your backup size is ${filesize} Bytes</echo>
<filesize file="./backup.zip" propertyname="backup.size"/> <echo>Your backup size is ${backup.size} Bytes</echo>
<filesize file="./backup.zip" unit="M"/> <echo>Your backup size is ${filesize} Megabytes</echo>