Re: For Wez : Stream Abstraction over a String
| From: | Andrei Zmievski | Date: | Tue, 23 Oct 2001 13:19:14 +0000 |
| Subject: | Re: For Wez : Stream Abstraction over a String | ||
| References: | 1 2 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-68807@lists.php.net to get a copy of this message | ||
On Tue, 23 Oct 2001, Wez Furlong wrote:
> Yep, or something like it.
>
> In some other code that I an using to test my streams idea, I have
> implemented something a bit like a TMemoryStream that can do more or
> less what you need - off the top of my head it looks sth like this;
>
> str = stream_mem_open(initial_string, initial_strlen);
> stream_write(str, "hello", sizeof("hello")-1);
> filestr = stream_fopen("license.txt", "r");
> stream_copy(filestr, str, 0); // the zero means until EOF of the src
> stream_close(filestr);
> char * output = stream_mem_get_ptr(str);
>
> This is not yet in PHP; it will be a couple of weeks before I can put
> it in there.
Perhaps I'm missing something, but can you explain how this is better
than what we have now?
-Andrei
* I don't have a solution but I admire the problem. *