file
file copied to clipboard
Inconsistent and incorrect behavior
require 'vendor/autoload.php';
$file = Amp\File\openFile('test.txt', 'a');
$file->write("test\n");
unset($file);
Revolt\EventLoop::run();
- When using default driver the execution hangs.
- When using eio driver the
a
mode behaves likew
. - When using uv driver it works but the file is not automatically closed in underlying destructors. I discovered this by encountering an anomalous chart of open file descriptors (similar code in a real module). Is it meant to be closed manually?
Thanks for reporting! I've committed fixes for 2 and 3. The fix for 1 is in https://github.com/amphp/byte-stream/pull/100.
All of those have been fixed now in the beta versions, I still need to take a look at the current stable version.