ID: 23406
Updated by: [EMAIL PROTECTED]
Reported By: gfraley5 at earthlink dot net
-Status: Assigned
+Status: Closed
Bug Type: Filesystem function related
Operating System: Win98SE,WinXP,Win2K
PHP Version: 4.3.2RC2
Assigned To: wez
New Comment:
PHP will force binary mode starting from 4.3.2.
If you need text mode, you now need to explicitly open with a 't' in
your mode string.
No doubt others will complain about this.
We didn't really change the default behaviour in the RC's; its actually
some strange inconsistency between ANSI and "posix" functions on the MS
libc.
Previous Comments:
------------------------------------------------------------------------
[2003-06-06 03:15:53] braden_marr at yahoo dot ca
I believe I may have run into this exact same problem after upgrading
to 4.3.2 ("gold" by now) (Apache SAPI) from 4.3.1 (Apache SAPI) on
WinXP/Apache 1.3.27. I am running Gallery (on sourceforge) on my web
site and found that users submitting photos broke the database; Gallery
uses serialize and deserialize to store it's often large objects as
files, and the \r\n vs \n used in objects that get serialized as files,
breaks the object's file. Since this "bug" seems to be still out in the
open and appears to be on the fence for Bogus, I am thinking the
Gallery dev should know about this new and special Win32/PHP4.3.2
problem and bend accordingly... unless of course, I am barking up the
wrong tree.
------------------------------------------------------------------------
[2003-05-17 19:22:25] gfraley5 at earthlink dot net
I would disagree. Since it was never manadatory to use the 'wb' then
making a change that forces it, needs to be announced, imo. Otherwise,
files will be ruined if the circumstances mentioned here are used.
------------------------------------------------------------------------
[2003-05-15 13:22:52] [EMAIL PROTECTED]
For me this looks like bogus.
------------------------------------------------------------------------
[2003-05-01 09:24:06] [EMAIL PROTECTED]
The reason for the change was primarily to avoid crippling limitations
for the number of opened files under Solaris, but has other benefits
for the streams API.
My opinion of the backwards compatibility issue here is that it should
be a non-issue; the fopen() docs have warned about binary mode for a
very long time. However, I think we will wait and see if we get any
more feedback on this issue before making a firm decision.
------------------------------------------------------------------------
[2003-05-01 09:18:37] gfraley5 at earthlink dot net
Thanks! I have submitted this in the past and it was rebuffed and
marked as bogus. I don't think it should be marked as bogus because it
is a definite backward compatability issue that will render files
useless (as it does with hundreds of my users that use legacy 'w'
instead of 'wb') if written to without the 'B' attribute. If anything,
it could/should be marked as an 'enhancement' or something as you have
changed the behavior whether intentionally or not. Was there a
specific reason why you wnet to the lower level call open()? If
nothing in particular, then maybe you leave 4.3.2 as is and prepare the
public and developers for the change in a future release. Just a
thought.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/23406
--
Edit this bug report at http://bugs.php.net/?id=23406&edit=1