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
Name | Type | Description | Default | Required |
---|---|---|---|---|
file | String | The name of the file. | n/a | Yes |
length | String | Specifies the file size.
Examples: 5000B , 250K , 1M .
| n/a | No |
adjust | String | The value to increase or decrease (if you specify a negative value)
the size of a file.
Examples: -100 , 250B , 4K .
| n/a | No |
create | Boolean | Whether to create nonexistent files. | true | No |
mkdirs | Boolean | Whether to create nonexistent parent directories when creating new files. | false | No |
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
Standard | Suffixes | Equivalence |
---|---|---|
IEC | B .
| 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 |