PHPackages                             microscrap/posix - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. microscrap/posix

ActiveLibrary[Framework](/categories/framework)

microscrap/posix
================

Unix POSIX Bindings for The PHP Posi Extension

0.4.0(2w ago)025MITPHPPHP ^8.3

Since May 21Pushed 2w agoCompare

[ Source](https://github.com/microscrap/posix)[ Packagist](https://packagist.org/packages/microscrap/posix)[ Docs](https://dosr.projectsaturnstudios.com)[ RSS](/packages/microscrap-posix/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependenciesVersions (2)Used By (5)

microscrap/posix — POSIX bindings for ScrapyardIO
=================================================

[](#microscrapposix--posix-bindings-for-scrapyardio)

PHP library that wraps the [**posi**](https://github.com/php-io-extensions/posi) extension with global helpers and enums. Every helper delegates to `Posi\System`.

This project provides bindings to the UNIX Portable Operating System Interface (POSIX).

Highlights
----------

[](#highlights)

- Retrieve file descriptors to replace `fopen`
- Read and write to file descriptors beyond streams, replacing `fread` and `fwrite`
- Direct access to `fcntl`
- Direct access to `ioctl`

Requirements
------------

[](#requirements)

- PHP 8.3+
- **ext-posi** ^0.4.0 — install from [php-io-extensions/posi](https://github.com/php-io-extensions/posi) (see that repo for build and enable instructions)

Installation
------------

[](#installation)

Confirm **ext-posi** is loaded before using this library:

```
php -m | grep posi
```

```
composer require microscrap/posix
```

Composer autoloads `src/Helpers/posix-system.php`, registering the global helpers when the package is installed.

Usage
-----

[](#usage)

POSIX I/O is invoked through **global helper functions** (for example `posix_open`, `posix_read`). Helpers are only defined if the name is not already taken (`function_exists` guard).

Optional enums live under `Microscrap\Bindings\POSIX\Enums` (`FileControlFlag`, `FcntlCommand`).

```
