Re: Bug #5708: fopen claims file does not exist after first couple uses.
| From: | Derick Rethans | Date: | Thu, 20 Jul 2000 19:59:54 +0000 |
| Subject: | Re: Bug #5708: fopen claims file does not exist after first couple uses. | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-25286@lists.php.net to get a copy of this message | ||
Hello,
how many files are you opening?
Derick
mark@peak-comm.com wrote:
> From: mark@peak-comm.com
> Operating system: Linux
> PHP version: 3.0.16
> PHP Bug Type: Misbehaving function
> Bug description: fopen claims file does not exist after first couple uses.
>
> 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.
>
> --
> PHP Development Mailing List <http://www.php.net/>
> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net
> For additional commands, e-mail: php-dev-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
--
Derick Rethans
JDI Media Solutions
H.v.Tussenbroekstraat 1
6952 BL Dieren
The Netherlands
e-mail: d.rethans@jdimedia.nl
http://www.jdimedia.nl/