Updating submodules
[hiphop-php.git] / hphp / test / slow / ext_stream / stream_copy_to_stream-seek.php
blobe6f9fe2343455878f18125411a1b534e30e05719
1 <?hh
4 // Create two temporary files.
5 <<__EntryPoint>>
6 function main_stream_copy_to_stream_seek() {
7 $file1 = tmpfile();
8 $file2 = tmpfile();
9 fwrite($file1, 'input');
10 fwrite($file2, 'before');
12 // Seek to specific position in destination.
13 rewind($file1);
14 fseek($file2, 2);
16 stream_copy_to_stream($file1, $file2);
18 // Show us all of file2.
19 echo stream_get_contents($file2, -1, 0);
21 // Cleanup.
22 fclose($file1);
23 fclose($file2);