Bug #12801 Updated: scope of opened files

From: Date: Fri, 17 Aug 2001 10:10:48 +0000
Subject: Bug #12801 Updated: scope of opened files
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-63507@lists.php.net to get a copy of this message
ID: 12801 User updated by: lumberjakel@hotmail.com Reported By: lumberjakel@hotmail.com Status: Bogus Bug Type: Filesystem function related Operating System: win98 PHP Version: 4.0.6 New Comment: thnx a great deal Previous Comments: ------------------------------------------------------------------------ [2001-08-17 01:17:28] derick@php.net This is intended. The filehandle is closed after the passthru() call. You need to reopen it. From the manual: The file pointer must be valid, and must point to a file successfully opened by fopen(), popen(), or fsockopen(). The file is closed when fpassthru() is done reading it (leaving fp useless). ------------------------------------------------------------------------ [2001-08-16 19:19:48] lumberjakel@hotmail.com Look at the following script-file: <html><body> <?php $fp1=fopen("project1.txt", "r"); fpassthru($fp1); ?> <br> some text <br> <?php fpassthru($fp1); ?> </body></html> You should get twice the content op project1.txt, seperated by "some text", but I get this: contents of project1.txt some text Warning: 1 is not a valid File-Handle resource in e:\documenten\scripts\test area\project11.php on line 10 ------------------------------------------------------------------------ Edit this bug report at http://bugs.php.net/?id=12801&edit=1

« previous php.dev (#63507) next »