ID:               24991
 Updated by:       [EMAIL PROTECTED]
 Reported By:      weife01 at ca dot com
-Status:           Open
+Status:           Feedback
 Bug Type:         Filesystem function related
 Operating System: Windows2000
 PHP Version:      4.3.2
 New Comment:

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.


Previous Comments:
------------------------------------------------------------------------

[2003-08-08 17:20:12] weife01 at ca dot com

On Windows2000, only Unix EOL works

------------------------------------------------------------------------

[2003-08-08 17:19:17] [EMAIL PROTECTED]

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

Reply via email to