truncate function

int truncate(
  1. String filename,
  2. int length
)

Implementation

int truncate(
  String filename, // ffi.Pointer<Utf8> file,
  int length,
) {
  final cFilename = filename.toNativeUtf8();
  _truncate ??= Libc().dylib.lookupFunction<
      ffi.Int32 Function(ffi.Pointer<Utf8>, ffi.Int64),
      _dart_truncate>('truncate');
  final result = _truncate!(
    cFilename,
    length,
  );

  malloc.free(cFilename);
  return result;
}