reactphp / filesystem

Evented filesystem access.
MIT License
135 stars 38 forks source link

When utilizing UV expansion, the putContents function cannot override the file content. #117

Open wpjscc opened 2 days ago

wpjscc commented 2 days ago

When utilizing UV expansion, the putContents function cannot override the file content.

use React\Filesystem\Factory;
use React\Filesystem\Node\FileInterface;

require 'vendor/autoload.php';

file_put_contents(__DIR__.'/a.text', '12345678');

Factory::create()->detect(__DIR__.'/a.text')->then(static function (FileInterface $file) {
    return $file->putContents('876');
})->then(static function ($result): void {
    var_export([$result]);
})->done();

// file content 87645678
wpjscc commented 1 day ago

fix https://github.com/reactphp/filesystem/pull/118