Bug #5708 Updated: fopen claims file does not exist after first couple uses.

From: Date: Sun, 09 Sep 2001 18:16:12 +0000
Subject: Bug #5708 Updated: fopen claims file does not exist after first couple uses.
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-65597@lists.php.net to get a copy of this message
ID: 5708 User updated by: mark@peak-comm.com Reported By: mark@peak-comm.com Status: Bogus Bug Type: Misbehaving function Operating System: Linux PHP Version: 3.0.16 New Comment: After upgrading to php 4, this problem disapeared. But it is still reproducable on any of my servers still running 3. Previous Comments: ------------------------------------------------------------------------ [2001-09-09 09:34:50] sterling@php.net I highly doubt this is truly a PHP bug, if you can find a test case that can always be reproduced, please open a new bug report. ------------------------------------------------------------------------ [2000-07-20 21:46:32] mark@peak-comm.com I'm opening up a series of files with fopen, and reading them into an array using fgets. After reading the first couple files in succesfully, fopen falsly reports that further files do not exist. Each of the failures echoes the $filename, if I take that URL and pull it up in a web browser, it retrieves the file. This is all in a loop that generates the filename variables. for (....... { $filename = "http://host.domain.com/" . $year . "/" . $months $month] . "/" . $day . "/" . "$query[$ws]" . ".txt"; $fd = @fopen($filename,"r"); if (!$fd) { print "Unable to open file: $filename" . "<br>"; $ws++; continue; } while (!feof($fd)) { $data[] = fgets($fd, 4096); } fclose ($fd); ....... } So what I end up with is proper information for the first file or two, the rest of the files fail regaurdless of whether they exist or not. ------------------------------------------------------------------------ Edit this bug report at http://bugs.php.net/?id=5708&edit=1

« previous php.dev (#65597) next »