amphp / file

An abstraction layer and non-blocking file access solution that keeps your application responsive.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ftruncate analogue

userqq opened this issue · comments

Hi.
Is there any plans to add ftruncate() analogue or any workaround?
Now I'm using something like that

yield \Amp\ParallelFunctions\parallel(function () use ($filename) {
    $fh = fopen($filename, 'c');
    ftruncate($fh, 1024);
    fclose($fh);
})();

but I think it's terrible solution

I'll add this function in the next release.

Great news.
Thank you

This has been implemented in master and will be part of v1.0.