Conversation
|
Implementation looks good to me. Looks like the read-only fsync tests are failing though. |
Maybe one of those would serve as a better test for the failure case. |
Passes on Windows but a quick Linux test indicates you can |
|
idk if this is severe enough, only thing i am really stuck on atm. |
|
Thank you for this PR, I'm happy it's voted accepted :) I was testing this out for a bit, and from what I see, I cannot get it to work with custom stream wrappers. Is that intended? stream_wrapper_register("test", "TestStream");
class TestStream {
function stream_open($path, $mode, $options, &$opened_path)
{
return true;
}
function stream_fsync() {
return true;
}
function stream_set_option() {
return true;
}
}
var_dump($r = fopen('test://dsa', 'w'));
fsync($r);This results in the warning Thank you. |
@Ayesh yes, this is intentional; |
nikic
left a comment
There was a problem hiding this comment.
Looks good, some minor style suggestions.
|
@nikic comments addressed, I think this is good to merge now. |
fsyncis a straightforward wrapper around the same C function (implemented on Windows API as_commit()with identical signature).From the man pages:
Small but potentially quite useful addition and perhaps something of an oversight that it's not in PHP core; PHP is the only major language I use which does not provide some interface to
fsync.Under discussion RFC https://wiki.php.net/rfc/fsync_function