filesystem icon indicating copy to clipboard operation
filesystem copied to clipboard

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

Open wpjscc opened this issue 1 year ago • 1 comments

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 avatar Oct 20 '24 13:10 wpjscc

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

wpjscc avatar Oct 20 '24 23:10 wpjscc