chdir function

int chdir(
  1. String path
)

Change the process's working directory to PATH.

Implementation

int chdir(String path // ffi.Pointer<Utf8> __path,
    ) {
  final cPath = path.toNativeUtf8();
  _chdir ??= Libc()
      .dylib
      .lookupFunction<ffi.Int32 Function(ffi.Pointer<Utf8>), _dart_chdir>(
          'chdir');
  final result = _chdir!(
    cPath,
  );

  malloc.free(cPath);
  return result;
}