The Nuxed Filesystem component provides classes that interact with the local filesystem. Specialized classes can be used to read data, write data, alter permissions, rename files, copy, create, delete, move, traverse, and many more through an easy to use interface.
This package can be installed with Composer.
$ composer require nuxed/filesystem
use namespace Nuxed\Filesystem;
<<__EntryPoint>>
async function main(): Awaitable<void> {
$file = new Filesystem\File('file.txt');
await $file->create(0755);
$file->write('Hello, World!');
print await $file->read(5); // Hello
$parent = $file->parent();
await $parent->flush();
$file->exists(); // false
}
For information on reporting security vulnerabilities in Nuxed, see SECURITY.md.
Nuxed is open-sourced software licensed under the MIT-licensed.