Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:26611 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 41273 invoked by uid 1010); 15 Nov 2006 18:19:39 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 41258 invoked from network); 15 Nov 2006 18:19:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Nov 2006 18:19:39 -0000 Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass; domainkeys=good Received-SPF: pass (pb1.pair.com: domain gmail.com designates 66.249.92.173 as permitted sender) DomainKey-Status: good X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 66.249.92.173 ug-out-1314.google.com Linux 2.4/2.6 Received: from [66.249.92.173] ([66.249.92.173:5797] helo=ug-out-1314.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8B/B8-21305-A3A5B554 for ; Wed, 15 Nov 2006 13:19:39 -0500 Received: by ug-out-1314.google.com with SMTP id 80so199610ugb for ; Wed, 15 Nov 2006 10:19:36 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=rbvn8VZ80+YJ/PqckyBoJssHdIORxrc/xej99kUiAC0PPWoHtQr0d+W5NvIBurhXHvJIGZqm8lw2Uwo6SKGcbc4mtUtB3jZeqDkvwtFbsLlK0m3oxdoCe5ufKyDqfFjis0mfwONaAUTHwyVaogXPMyqewNYAkoLfF45gdlHUeEQ= Received: by 10.78.127.3 with SMTP id z3mr109337huc.1163614775683; Wed, 15 Nov 2006 10:19:35 -0800 (PST) Received: by 10.78.137.6 with HTTP; Wed, 15 Nov 2006 10:19:35 -0800 (PST) Message-ID: Date: Wed, 15 Nov 2006 19:19:35 +0100 To: php-dev , "Wez Furlong" , "Dmitry Stogov" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: Subject: Re: Windows SAPI possible binary file operation bug and possible fix From: pierre.php@gmail.com (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(). 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