ID: 22682 Comment by: nicolas dot castagne at imag dot fr Reported By: fbeyer at clickhand dot de Status: No Feedback Bug Type: Filesystem function related Operating System: Windows XP PHP Version: 4CVS-2003-04-28 (stable) New Comment:
I don't use Python, but found this bug report and can add a comment. Windows c library has a bug with ftell. See : http://mail.python.org/pipermail/python-bugs-list/2006-January/031684.html http://www.cygwin.com/faq/faq.api.html http://sourceforge.net/tracker/index.php?func=detail&aid=1381717&group_id=5470&atid=105470 http://gnuwin32.sourceforge.net/compile.html Previous Comments: ------------------------------------------------------------------------ [2004-04-27 00:45:23] frank at heuveltop dot nl I run PHP as a Apache (2.0.48) module. I tried several methods but there is no way PHP will read "\r" from the file. The filepointer returned by ftell is getting out of sync. I do confirm all the symptoms that are stated above. Allthought I can build a workaround by counting lines and add the number of lines to ftell, I am worried about reading binary files like images by GD library. ------------------------------------------------------------------------ [2003-11-28 15:32:18] alexey at ozerov dot de I still have a related bug on Windows XP using PHP 4.3.4. Sample: <? header("Content-type: text/plain"); ini_set("auto_detect_line_endings", true); // Doesn't matter $file=fopen(__FILE__,"rt"); // "t" doesn't matter too $linenumber=0; while ($file && $line=fgets($file, 65536)) { echo ("$linenumber: ".$line."\n"); fseek($file, ftell($file), SEEK_SET); $linenumber++; } fclose($file); ?> fseek() should not do anything but it _shifts_ the file pointer (as many bytes back as many "\r" are in the last read input) if I the __FILE__ has DOS encoded line breaks. As the result every line is followed by a blank line in the sample output. ------------------------------------------------------------------------ [2003-08-17 18:34:15] [EMAIL PROTECTED] No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Open". Thank you. ------------------------------------------------------------------------ [2003-08-12 19:41:45] [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-05-11 08:28:04] [EMAIL PROTECTED] As Wez pointed out above, this is a generic __setmode() issue. status: open => verified ------------------------------------------------------------------------ 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/22682 -- Edit this bug report at http://bugs.php.net/?id=22682&edit=1
