truncateFile method

  1. @override
void truncateFile(
  1. String path,
  2. int length
)
override

Sets the size of the file at path to length.

If the file was smaller than length before, the rest is filled with zeroes.

Implementation

@override
void truncateFile(String path, int length) {
  _checkClosed();
  _memory.truncateFile(path, length);

  if (!_inMemoryOnlyFiles.contains(path)) {
    _submitWorkFunction(
        () async => _asynchronous.truncate(await _fileId(path), length),
        'truncate $path');
  }
}