#24991 [Fbk->Opn]: On windows2000, only Unix EOF works
| From: | weife01 at ca dot com | Date: | Fri, 08 Aug 2003 22:26:01 +0000 |
| Subject: | #24991 [Fbk->Opn]: On windows2000, only Unix EOF works | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-45604@lists.php.net to get a copy of this message | ||
ID: 24991
User updated by: weife01 at ca dot com
Reported By: weife01 at ca dot com
-Status: Feedback
+Status: Open
Bug Type: Filesystem function related
Operating System: Windows2000
PHP Version: 4.3.2
New Comment:
But I couldn't rtrim() my code for it runs fine all these time until
this client uses PHP script.
I'd like to find out why running under PHP, my fgets function behavour
differently.
Previous Comments:
------------------------------------------------------------------------
[2003-08-08 17:21:40] moriyoshi@php.net
fgets() doesn't automagically trim EOL charactres.
http://www.php.net/fgets
Perhaps what to do next is rtrim() it at the appropriate place of your
code and see if it works.
------------------------------------------------------------------------
[2003-08-08 17:20:12] weife01 at ca dot com
On Windows2000, only Unix EOL works
------------------------------------------------------------------------
[2003-08-08 17:19:17] edink@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php4-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-STABLE-latest.zip
------------------------------------------------------------------------
[2003-08-08 17:15:48] weife01 at ca dot com
Description:
------------
I have a client who runs PHP on Windows and use the PHP script calling
my program, which it initialize the DB connection. My initialization
will fail if one of the text file my program reads is in Windows format
with EOL as \r\n. If I feed it with Unix format as EOL(\n only), the
initialization is succeed. By debugging my own code, I found that my
fgets, when calling by PHP script, always return one more byte than it
should, means it doesn't recognize the \r on Windows as part of EOL. I
have my client set the auto_detect_line_endings in his php.ini, but it
didn't help.
I have seen that you have similar bug 16708 reported, but this bug
sounds reverse. I wonder if the fgets alters runtime library, and cause
my fgets gets altered?
Reproduce code:
---------------
My program breaks only when calling by PHP, but I was unable to attach
it here because of it's size.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=24991&edit=1