Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.4.1

Bug #1191 File::readLine() stops on blank lines
Submitted: 2004-04-13 04:17 UTC
From: ieure at php dot net Assigned:
Status: Bogus Package: File
PHP Version: Irrelevant OS: Debian Linux
Roadmaps: (Not assigned)    
Subscription  


 [2004-04-13 04:17 UTC] ieure at php dot net
Description: ------------ When readLine() comes to an empty line in a text file, it stops. Reproduce code: --------------- while ($line = File::readLine('file')) { print $line; } compare with: $fp = fopen('file', 'r'); while ($line = fgets($fp, 1024)) { print $line; } fclose($fp); Expected result: ---------------- The while loop should continue until all lines in 'file' have been read and returned. Actual result: -------------- The while loop stops at the first empty line in 'file'

Comments

 [2004-04-13 18:57 UTC] richard at phpguru dot org
Your code is at fault, not the package.
 [2004-05-19 08:02 UTC] ieure at php dot net
In what way is my code at fault? The File documentation does not indicate any methods to either determine the number of lines in a file, nor to determine if there are lines left to be read.
 [2004-06-03 14:31 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!