lchown function

int lchown(
  1. String filename,
  2. int owner,
  3. int group
)

Change owner and group of FILE, if it is a symbolic link the ownership of the symbolic link is changed.

Implementation

int lchown(
  String filename, // ffi.Pointer<Utf8> file,
  int owner,
  int group,
) {
  final cFilename = filename.toNativeUtf8();

  _lchown ??= Libc().dylib.lookupFunction<
      ffi.Int32 Function(ffi.Pointer<Utf8>, ffi.Uint32, ffi.Uint32),
      _dart_lchown>('lchown');
  final result = _lchown!(
    cFilename,
    owner,
    group,
  );

  malloc.free(cFilename);
  return result;
}