Manages strict read and write operations.

2.7.0 2017-06-12 17:31 UTC

This package is auto-updated.

Last update: 2022-07-29 01:29:13 UTC


Build Status Packagist Packagist Pre Release

File Manager

Manages strict read and write operations for files and file streams.


use KHerGe\File\File;

// Create a new file manager.
$file = new File('example.txt', 'r');

// Iterate through the contents of the file.
foreach ($file->iterate() as $buffer) {
    // ...


Add as a dependency to a Composer managed project.

composer require kherge/file-manager


Please refer to FileInterface for documentation.

use KHerGe\File\File;
use KHerGe\File\Memory;
use KHerGe\File\Stream;

// Create a manager for a file.
$manager = new File('example.txt', 'r');

// Create a manager for a string.
$manager = new Memory('example contents', false);

// Create a manager for a file stream.
$manager = new Stream($stream);


File Manager is dual licensed under MIT and Apache 2.0.