Re: Re: memory streams
| From: | (Marcus Börger) | Date: | Sun, 17 Mar 2002 03:11:05 +0000 |
| Subject: | Re: Re: memory streams | ||
| References: | 1 2 3 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-81372@lists.php.net to get a copy of this message | ||
At 02:56 17.03.2002, Wez Furlong wrote:
Hi Markus, (Sorry: I think I deleted the most relevant mail, so I'm replying to this one :-) Thanks for your work on the memory streams; I have a couple of comments about them: As they stand now, it is only possible to write in append mode. (Or it looked that way from my quick glance). It would be really good if data could be written over existing data if the stream is seek()ed.they do an auto resize so append will work but you can also use seek to overwrite in a memory stream.
Using the memory stream as an alternative when you need to seek a possibly unseekable stream is good for smaller data, but what about larger data?Yes this is only the first commit just going on with an automatic stream that switches to temporary files if needed. I also thought about having a configure option wich allows memory streams to always use temp files on machines where temp files are always in memory. Besides this point i only used ext/exif to have memory streams tested.
I'm planning an API that will give you back a seekable stream so the logic to determine when and what type of alternative to use; we can use memory streams, but I think I'd feel happier if we used a tmpfile() stream instead; if the data is small enough, a sensible OS would cache the file in memory anyway.Mybe we should combine our work but go on you worked out a *very* nice api and did a great work for php!
As for the strange problems you have in the exif extension; if you switch to a stream opened with php_stream_fopen_tmpfile(), do you still have the same troubles? (So we can try and pin it down!).Check this later...
--Wez. -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php