rmdir function

void rmdir(
  1. String path
)

Remove the directory PATH.

Throws a PosixException if the delete fails.

Implementation

void rmdir(String path) {
  final cPath = path.toNativeUtf8();
  _rmdir ??= Libc()
      .dylib
      .lookupFunction<ffi.Int32 Function(ffi.Pointer<Utf8>), _dart_rmdir>(
          'rmdir');
  final result = _rmdir!(
    cPath,
  );

  _throwIfErrno('rmdir', result, cPath);

  malloc.free(cPath);
}