os 0.1.2

Dart native
Flutter Android iOS

Access to operating system APIs (using 'dart:ffi'). Virtual memory management, IPC pipes, file permissions, etc.

Overview #

This package provides access to various low-level APIs of operating systems. The package binds with libc (Linux, Mac OS X) and kernel32.dll (Windows) using dart:ffi.

The project is licensed under the Apache License 2.0.

Status #

Passes tests in:

  • Darwin (OS X)

Fails tests in:

  • Linux
  • Windows

Issues? #

APIs #

os.file_system #

Library 'package:os/file_system.dart' provides access to various functions not supported by 'dart:io'.

Examples:

chmodSync(Directory("some/path"), 0x1FF); // Octal: 777

Named pipes (also known as "POSIX pipes") are sometimes used for inter-process communication in operating systems such as Linux and Mac OS X.

void main() async {
  // Create the pipe
  final namedPipe = NamedPipe("some/path");
  namedPipe.createSync();

  // Write something
  final writer = namedPipe.openWrite()
  writer.add([1,2,3])
  await writer.close();

  // Delete the pipe
  namedPipe.deleteSync();
}

os.virtual_memory #

Library 'package:os/memory.dart' enables you to control virtual memory tables.

void main() async {
  // Allocate memory
  final memory = VirtualMemory.allocate(1024);

  // Set protection bits
  memory.setProtection(VirtualMemory.protectionReadWrite);

  // Write to the memory
  memory.asUint8List[23] = 29;

  // Free the memory
  memory.free();
}
3
likes
100
pub points
15%
popularity

Access to operating system APIs (using 'dart:ffi'). Virtual memory management, IPC pipes, file permissions, etc.

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

terrier989@gmail.com

License

Apache 2.0 (LICENSE)

Dependencies

ffi, meta

More

Packages that depend on os