Hi internals,
As there appear to be no objections or concerns, I intend to open voting on https://wiki.php.net/rfc/fsync_function tomorrow and voting will remain open for two weeks.
The RFC and its implementation
- Adds functions
fsync()andfdatasync()for plain file streams on Unix systems. - Adds function
fsync()on Windows withfdatasync()available as an alias
PR ref https://github.com/php/php-src/pull/6650
Regards,
David Gebler
Voting is now open for 2 weeks on https://wiki.php.net/rfc/fsync_function
Regards,
David Gebler
Quoted text · 8 lines
Hi internals,
As there appear to be no objections or concerns, I intend to open voting on https://wiki.php.net/rfc/fsync_function tomorrow and voting will remain open for two weeks.The RFC and its implementation
- Adds functions
fsync()andfdatasync()for plain file streams on Unix systems.- Adds function
fsync()on Windows withfdatasync()available as an aliasPR ref https://github.com/php/php-src/pull/6650
Regards,
David Gebler
Hey David,
http://ocramius.github.com/
Quoted text · 10 lines
Voting is now open for 2 weeks on https://wiki.php.net/rfc/fsync_function
Regards,
David GeblerOn Tue, Feb 23, 2021 at 5:15 PM David Gebler davidgebler@gmail.com wrote:
Hi internals,
As there appear to be no objections or concerns, I intend to open voting on https://wiki.php.net/rfc/fsync_function tomorrow and voting will remain open for two weeks.The RFC and its implementation
- Adds functions
fsync()andfdatasync()for plain file streams on Unix systems.- Adds function
fsync()on Windows withfdatasync()available as an alias
Just clarifying on my "NO" vote: I'm opposed to having more E_WARNING raised by the language.
We have better approaches for that:
- exceptions
- union types
- Maybe/Either types
I don't see a reason to introduce a warning here, and it makes the function unusable unless some poor soul implements a library that gets rid of the warning.
Marco Pivetta
Quoted text · 18 lines
Hey David,
http://ocramius.github.com/Voting is now open for 2 weeks on https://wiki.php.net/rfc/fsync_function
Regards,
David GeblerOn Tue, Feb 23, 2021 at 5:15 PM David Gebler davidgebler@gmail.com wrote:
Hi internals,
As there appear to be no objections or concerns, I intend to open voting on https://wiki.php.net/rfc/fsync_function tomorrow and voting will remain open for two weeks.The RFC and its implementation
- Adds functions
fsync()andfdatasync()for plain file streams on Unix systems.- Adds function
fsync()on Windows withfdatasync()available as an aliasJust clarifying on my "NO" vote: I'm opposed to having more
E_WARNINGraised by the language.We have better approaches for that:
- exceptions
- union types
- Maybe/Either types
I don't see a reason to introduce a warning here, and it makes the function unusable unless some poor soul implements a library that gets rid of the warning.
Note that this warning is never supposed to occur in production, because it is a programming error to pass a wrong resource type. Rasing a warning for wrong resource types is standard behavior of zend_fetch_resource() (unless no resource type name is passed). I don't see why these new functions should use a non standard mechanism.
Of course, in the long run resources should go away, which would resolve this issue for these functions as well.
--
Christoph
On Thu, Feb 25, 2021 at 1:01 PM Christoph M. Becker cmbecker69@gmx.de wrote:
Quoted text · 24 lines
Hey David,
http://ocramius.github.com/On Wed, Feb 24, 2021 at 6:15 PM David Gebler davidgebler@gmail.com wrote:
Voting is now open for 2 weeks on
https://wiki.php.net/rfc/fsync_functionRegards,
David GeblerOn Tue, Feb 23, 2021 at 5:15 PM David Gebler davidgebler@gmail.com wrote:
Hi internals,
As there appear to be no objections or concerns, I intend to open voting
on https://wiki.php.net/rfc/fsync_function tomorrow and voting will remain open for two weeks.The RFC and its implementation
- Adds functions
fsync()andfdatasync()for plain file streams on Unix systems.- Adds function
fsync()on Windows withfdatasync()available as an aliasJust clarifying on my "NO" vote: I'm opposed to having more
E_WARNINGraised by the language.We have better approaches for that:
- exceptions
- union types
- Maybe/Either types
I don't see a reason to introduce a warning here, and it makes the function
unusable unless some poor soul implements a library that gets rid of the warning.Note that this warning is never supposed to occur in production, because it is a programming error to pass a wrong resource type. Rasing a warning for wrong resource types is standard behavior of zend_fetch_resource() (unless no resource type name is passed). I don't see why these new functions should use a non standard mechanism.
Of course, in the long run resources should go away, which would resolve this issue for these functions as well.
A wrong resource type will throw a TypeError as usual -- the warning is thrown if the resource is of the correct type (stream), but does not support sync operations. For example, if you tried to do an fsync on an http:// stream.
Throwing a warning in such a case is consistent with how functions for other optional stream operations work.
Regards,
Nikita
Quoted text · 26 lines
On Thu, Feb 25, 2021 at 1:01 PM Christoph M. Becker cmbecker69@gmx.de wrote:
Hey David,
http://ocramius.github.com/On Wed, Feb 24, 2021 at 6:15 PM David Gebler davidgebler@gmail.com wrote:
Voting is now open for 2 weeks on
https://wiki.php.net/rfc/fsync_functionRegards,
David GeblerOn Tue, Feb 23, 2021 at 5:15 PM David Gebler davidgebler@gmail.com wrote:
Hi internals,
As there appear to be no objections or concerns, I intend to open voting
on https://wiki.php.net/rfc/fsync_function tomorrow and voting will remain open for two weeks.The RFC and its implementation
- Adds functions
fsync()andfdatasync()for plain file streams on Unix systems.- Adds function
fsync()on Windows withfdatasync()available as an aliasJust clarifying on my "NO" vote: I'm opposed to having more
E_WARNINGraised by the language.We have better approaches for that:
- exceptions
- union types
- Maybe/Either types
I don't see a reason to introduce a warning here, and it makes the function
unusable unless some poor soul implements a library that gets rid of the warning.Note that this warning is never supposed to occur in production, because it is a programming error to pass a wrong resource type. Rasing a warning for wrong resource types is standard behavior of zend_fetch_resource() (unless no resource type name is passed). I don't see why these new functions should use a non standard mechanism.
Of course, in the long run resources should go away, which would resolve this issue for these functions as well.
A wrong resource type will throw a TypeError as usual -- the warning is thrown if the resource is of the correct type (stream), but does not support sync operations. For example, if you tried to do an fsync on an http:// stream.
Ah, thanks for the correction! (I'm doing too much PHP 7, still.)
Throwing a warning in such a case is consistent with how functions for other optional stream operations work.
ACK.
--
Christoph
Het Nikita,
Throwing a warning in such a case is consistent with how functions for other optional stream operations work.
I understand that, and I'm OK with being against it.
Marco Pivetta
Thanks Marco, objection understood. I think Nikita's already said what I would say, from my view I can only reiterate I felt it was more appropriate to keep the behaviour consistent with how similar stream ops work.
Regards
David Gebler
Quoted text · 6 lines
Het Nikita,
Throwing a warning in such a case is consistent with how functions for other optional stream operations work.
I understand that, and I'm OK with being against it.
Marco Pivetta