Re: Keeping file pointers open after script end
| From: | Robert Cummings | Date: | Sat, 09 Jun 2007 20:51:52 +0000 |
| Subject: | Re: Keeping file pointers open after script end | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-256466@lists.php.net to get a copy of this message | ||
On Sat, 2007-06-09 at 22:44 +0200, Tijnema wrote:
> Hi,
>
> Is there any way to keep a file pointer open after script is finished,
> so that it can be access later, by passing it through session?
>
> Like this:
>
> page1.php:
>
> <?php
> session_start();
>
> $fp = fopen("test.php","r");
> $data = fread($fp,10);
> $_SESSION['fp'] = $fp;
>
> echo "<a href='page2.php'>Continue</a>";
> ?>
>
> page2.php:
>
> <?php
> session_start();
> $fp = $_SESSION['fp'];
> $data = fread($fp,10); // Should be bytes 11-20
> ?>
No, and why would you want to? Just pass the file path along.
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com
|
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'