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. Also in my test code I have the SSL client code working and tested; I'm looking forward to commiting this stuff. I had a crazy idea for streams; It came about when implementing an HTTP client. The concept is that the HTTP client code needs to separate the headers from the body; to do this it needs to buffer the web server output in memory. Once it has the headers though, it's not really a great idea to continue buffering in memory, especially if the data is large. So, how about an "amalgam stream" ? An amalgam stream is read-only and is actually just a layer on top of an array of streams; the amalgam stream maintains an index into that array and will continue reading it until it gets to the EOF. When that happens, it advances to the next stream and continues reading from there. When there are no more streams to go through, it returns EOF. --Wez. On 23/10/01, "l0t3k" <[EMAIL PROTECTED]> wrote: > Wez, > im not sure if you had planned to do so, but it would be ultra nice to > have a stream implemented over an expandable string (for instance wrapping > Sascha's smart-strings). its one of the niceties i like in Delphi - you can > do something like this : > InitialString := 'This is some data'; > str := TStringStream.Create(InitialString); > str.Write("hello", sizeof('hello')); > fileStream := TFileStream.Create('license.txt',fmOpenRead); > str.CopyFrom( fileStream, fileStream.Size ); > fileStream.free; > output := str.DataString; > writeln( output ); -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]