[PHP-DEV] Re: php_copy_file
+1 i need this for stuff im doing anyway... Wez Furlong [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Any objections to stream enabling the php_copy_file function; this will allow copying to/from anything that can be accessed by the stream fopen wrappers? --Wez. -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Re: php_copy_file
Wez, i keep forgetting to ask you to add a standard stream copy function (perhaps using a configurable buffer). that way, i can write me a simple streamer by fopening my favorite MP3 and copying it to a socket g Wez Furlong [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Any objections to stream enabling the php_copy_file function; this will allow copying to/from anything that can be accessed by the stream fopen wrappers? --Wez. -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Re: php_copy_file
Howzat? you da man ! i owe you a beer if ever we meet.. Wez Furlong [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Well, we have this: php_stream_copy_to_stream(srcstream, deststream, maxlen) that does that kind of thing :-) If maxlen is 0 it copies until EOF. It has some sense to use mmap when the source is a plain file too. Howzat? --Wez. On 16/03/02, l0t3k [EMAIL PROTECTED] wrote: Wez, i keep forgetting to ask you to add a standard stream copy function (perhaps using a configurable buffer). that way, i can write me a simple streamer by fopening my favorite MP3 and copying it to a socket g Wez Furlong [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Any objections to stream enabling the php_copy_file function; this will allow copying to/from anything that can be accessed by the stream fopen wrappers? --Wez. -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Re: php_copy_file
At 20:55 15.03.2002, you wrote: Well, we have this: php_stream_copy_to_stream(srcstream, deststream, maxlen) that does that kind of thing :-) If maxlen is 0 it copies until EOF. It has some sense to use mmap when the source is a plain file too. Should react on -1 otherwise you cannot call the function in code where the length is calculated automatically. Say you have stream a = length data*length read length copy_stream_to_stream(length) now it fails because you expect if (lngth) copy_strwam_to_stream(length) regards marcus Howzat? --Wez. On 16/03/02, l0t3k [EMAIL PROTECTED] wrote: Wez, i keep forgetting to ask you to add a standard stream copy function (perhaps using a configurable buffer). that way, i can write me a simple streamer by fopening my favorite MP3 and copying it to a socket g Wez Furlong [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Any objections to stream enabling the php_copy_file function; this will allow copying to/from anything that can be accessed by the stream fopen wrappers? --Wez. -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Re: php_copy_file
I'm not quite sure I know what you mean... Do you mean that if maxlen is -1, the function should not do anything? --Wez. On 16/03/02, Marcus Börger [EMAIL PROTECTED] wrote: At 20:55 15.03.2002, you wrote: php_stream_copy_to_stream(srcstream, deststream, maxlen) If maxlen is 0 it copies until EOF. Should react on -1 otherwise you cannot call the function in code where the length is calculated automatically. Say you have stream a = length data*length read length copy_stream_to_stream(length) now it fails because you expect if (lngth) copy_strwam_to_stream(length) -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Re: php_copy_file
At 02:53 16.03.2002, Wez Furlong wrote: I'm not quite sure I know what you mean... Do you mean that if maxlen is -1, the function should not do anything? No it should copy until EOF on -1 but do nothing on 0 because zero means zero. marcus --Wez. On 16/03/02, Marcus Börger [EMAIL PROTECTED] wrote: At 20:55 15.03.2002, you wrote: php_stream_copy_to_stream(srcstream, deststream, maxlen) If maxlen is 0 it copies until EOF. Should react on -1 otherwise you cannot call the function in code where the length is calculated automatically. Say you have stream a = length data*length read length copy_stream_to_stream(length) now it fails because you expect if (lngth) copy_strwam_to_stream(length) -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Re: php_copy_file
Good point; fix going in now... --Wez. On 16/03/02, Marcus Börger [EMAIL PROTECTED] wrote: At 02:53 16.03.2002, Wez Furlong wrote: I'm not quite sure I know what you mean... Do you mean that if maxlen is -1, the function should not do anything? No it should copy until EOF on -1 but do nothing on 0 because zero means zero. marcus --Wez. On 16/03/02, Marcus Börger [EMAIL PROTECTED] wrote: At 20:55 15.03.2002, you wrote: php_stream_copy_to_stream(srcstream, deststream, maxlen) If maxlen is 0 it copies until EOF. Should react on -1 otherwise you cannot call the function in code where the length is calculated automatically. Say you have stream a = length data*length read length copy_stream_to_stream(length) now it fails because you expect if (lngth) copy_strwam_to_stream(length) -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php