posix
6.5.4, released 3 weeks ago by onepub.dev
Exposes the POSIX api on OSx and Linux via an idiomatic Dart API.
What it does
Provides Dart access to the POSIX API for macOS and Linux systems using FFI. It translates C types to Dart types and throws PosixException on errors instead of returning error codes.
AI-written summary of version 6.5.4, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to access POSIX system APIs on macOS or Linux from Dart
- You want idiomatic Dart functions and exceptions instead of raw FFI bindings
Skip it when
- You are targeting platforms other than macOS and Linux
- You do not want native dependencies or FFI setup
Strengths
- Translates C types to idiomatic Dart types
- Modern error handling using exceptions rather than error codes
Weaknesses
- Limited to macOS and Linux platforms
- Requires platform-specific native libraries and ffigen for development
Setup
- Kind
- FFI (native library)
- Effort
- Medium
- Code generation
- No
- Direct dependencies
- 3
Requires libclang-dev and running ffigen to generate or update bindings.
import 'package:posix/posix.dart';
int uid = getuid();Works with
Packages commonly used together with posix: ones it builds on, ones built on it, and its own family.
- ffiposix depends on itUtilities for working with Foreign Function Interface (FFI) code in Dart.
- archiveBuilt on posixEncodes and decodes archive and compression formats such as zip, tar, gzip, and zlib.
- dcliBuilt on posixA Dart SDK for building cross‑platform command line applications and scripts.
- sodiumBuilt on posixDart bindings for the libsodium cryptographic library for Dart-VM and Web.