[PHP-DEV] Re: Windows SAPI possible binary file operation bug and possible fix

2006-11-15 Thread Pierre
Hello, On 11/15/06, Wez Furlong <[EMAIL PROTECTED]> wrote: We cannot change it in SAPI where we are not the .exe because we don't own the process. Messing with that flag affects the entire process and could break things at a higher level. I call this kind of thing "library abuse", where one pie

[PHP-DEV] Re: Windows SAPI possible binary file operation bug and possible fix

2006-11-15 Thread Pierre
Hello, On 11/15/06, Wez Furlong <[EMAIL PROTECTED]> wrote: We cannot change it in SAPI where we are not the .exe because we don't own the process. Messing with that flag affects the entire process and could break things at a higher level. I call this kind of thing "library abuse", where one pie

[PHP-DEV] Re: Windows SAPI possible binary file operation bug and possible fix

2006-11-15 Thread Wez Furlong
We cannot change it in SAPI where we are not the .exe because we don't own the process. Messing with that flag affects the entire process and could break things at a higher level. I call this kind of thing "library abuse", where one piece of code assumes that it is the only consumer of the librar

[PHP-DEV] Re: Windows SAPI possible binary file operation bug and possible fix

2006-11-15 Thread Pierre
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().

[PHP-DEV] Re: Windows SAPI possible binary file operation bug and possible fix

2006-11-15 Thread Pierre
On 11/15/06, Pierre <[EMAIL PROTECTED]> wrote: _fmode is global per process. We should set the mode of stdin/out: _setmode( _fileno( stdin ), _O_BINARY ); If we need it and if it is already opened when we init the SAPI, but someone has to verify this point. I just checked it, we do set the m