B.65 TruncateTask

Modify the length of a file, as the intermittently available truncate Unix utility/function.

When length and adjust are not set an empty file is created.

Table B.68: Attributes

NameTypeDescriptionDefaultRequired
file String The name of the file.n/aYes
length String Specifies the file size. Examples: 5000B, 250K, 1M. n/aNo
adjust String The value to increase or decrease (if you specify a negative value) the size of a file. Examples: -100, 250B, 4K. n/aNo
create Boolean Whether to create nonexistent files. true No
mkdirs Boolean Whether to create nonexistent parent directories when creating new files. false No

Note

File size can be written using IEC and SI suffixes, bytes are assumed when suffix is not specified. The following suffixes (case-insensitive) are supported:

Table B.69: Supported file size suffixes

StandardSuffixesEquivalence
IECB. 1 byte
K, Ki, KiB, kibi, kibibyte. 1024 bytes
M, Mi, MiB, mebi, mebibyte. 1024 kibibytes
G, Gi, GiB, gibi, gibibyte. 1024 mebibytes
T, Ti, TiB, tebi, tebibyte. 1024 gibibytes
SI kB, kilo, kilobyte. 1000 bytes
MB, mega, megabyte. 1000 kilobytes
GB, giga, gigabyte. 1000 megabytes
TB, tera, terabyte. 1000 gigabytes

B.65.1 Examples

<truncate file="foo" />