ID: 26510 User updated by: thomas303 at web dot de Reported By: thomas303 at web dot de -Status: Feedback +Status: Open Bug Type: Filesystem function related Operating System: Suse Linux 8.2 PHP Version: 4.3.5-dev New Comment:
Hi, I just wanted to send you some additional information about the way I tested: I tested importing a File on 3 Systems: - 2 times php4.3.3 - 1 time php4.3.5-dev I used one file on all these tests and every time I got the problem with fgetcsv which got solved using gets and explode. Using another system with php4.3.3, same data structure but other data in 30,000 rows, I have never had a problem. So it could be the data or maybe fgetcsv is not binary safe. I didn't have the problem some days ago under same circumstances with nearly the same data and size. I spent hours in trying to reproduce why the error occurs, but I can't. Maybe a look into the PHP source code helps you more than I can at the moment. I can't give you the original file as I already wrote. But I'll spend some minutes in creating a test script. Best regards, Thomas Previous Comments: ------------------------------------------------------------------------ [2003-12-03 14:45:45] [EMAIL PROTECTED] Please provide the prolematic cvs file and shortest possible script that can be used to replicate the problem. ------------------------------------------------------------------------ [2003-12-03 14:38:39] thomas303 at web dot de Hi, installing PHP Version 4.3.5-dev (Dec 2 2003 02:59:04) did not solve the problem. Best regards, Thomas ------------------------------------------------------------------------ [2003-12-03 13:41:06] [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-12-03 13:28:19] thomas303 at web dot de Description: ------------ Hi, I use the function fgetcsv, but it imported only 17860 of 20900 rows. Tried \r\n and \n. I found out, that rows are missing in between of the file, not at the beginning or the end. When I import only these rows (grepped before), everything works fine. It imports some rows, misses one, imports some and so on. The error occured the last days without a change in file structure or php. It could be the data itself which leads to the error. I can't reproduce it nor can I send you the file because of data protection reasons. With fgets and explode everything is fine again. You should check against if fgetcsv works the same way or map fgetcsv to fgets and explode. Reproduce code: --------------- $fields=fgetcsv($fp,4096,"|"); with loop and so on. Expected result: ---------------- $fields=fgetcsv($fp,4096,"|"); should work exactly the same as $newline=fgets($fp,4096); $fields=explode("|", $newline); ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=26510&edit=1