Hi Dmitry,
I think that changing global behavior (_fmode = _O_BINARY;) is not a good idea. May be this code should be removed from CGI and CLI too.
A big -1. It works and is known to work. It has been there since years.
May be we have a bug somewhere and _O_BINARY is not passed to open().
It is a knonw issue on windows (which I did not know). You can check other projects, they all force the mode using _fmode and _setmode for std*. As CGI/CLI have proven, it works well with the mode forced to binary. Or do you have informations telling that we should change that in CGI/CLI and embed?
Do you think the bug is in CRT?
It is a broken behavior somewhere in the windows API. As far as I can see, it is not in the public part, I run my code until I reached the ASM level in the debugger but the mode was correct (try codesearch).
What VC version do you use?
It is a bug in php releases (vc6), and in all my attempts (vc express and 2003). Unless there is a good reason to do not force the mode, I'm in favour to do it as well in the other SAPI. We do it in FCGI and CLI which the most used SAPI on windows, I don't think it is a good idea to introduce bugs by changing the default mode. I can fix this problem only in zip (like I have to do it for PECL) by initializing the mode when I enter a zip function and restore it on leaving. But it will be a pita and will not solve this problem for any other extensions relying on the same windows function. --Pierre -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php