truncate method

void truncate()

Truncates a file by setting its length to zero.

e.g.

'/tmp/log'.truncate()
'/tmp/log'.append('Start of Log')

See write and append

Implementation

void truncate() {
  withOpenFile(this, (file) {
    file.truncate();
  });
}