import zend standard tests
[hiphop-php.git] / hphp / test / zend / bad / ext-standard-file / stat_variation5-win32.php
blob0fe44c55edc703bf531d63ba8353a096862406d0
1 <?php
3 /*
4 * Prototype: array stat ( string $filename );
5 * Description: Gives information about a file
6 */
8 /* test the stats of file opened in write mode and then same in read mode */
10 $file_path = dirname(__FILE__);
11 require "$file_path/file.inc";
14 $file_handle = fopen("$file_path/stat_variation5.tmp", "w"); // temp file
15 fclose($file_handle);
18 echo "\n*** Testing stat(): on a file with read/write permission ***\n";
20 $filename = "$file_path/stat_variation5.tmp";
21 $file_handle = fopen($filename, "w"); // create file
22 fclose($file_handle);
23 $old_stat = stat($filename);
24 // clear the stat
25 clearstatcache();
26 sleep(2);
27 // opening file again in read mode
28 $file_handle = fopen($filename, "r"); // read file
29 fclose($file_handle);
30 $new_stat = stat($filename);
31 // compare self stats
32 var_dump( compare_self_stat($old_stat) );
33 var_dump( compare_self_stat($new_stat) );
34 // compare the stat
35 $affected_members = array(10, 'ctime');
36 var_dump( compare_stats($old_stat, $new_stat, $affected_members, "=") );
37 // clear the stat
38 clearstatcache();
41 echo "\n*** Done ***";
43 <?php
44 $file_path = dirname(__FILE__);
45 unlink("$file_path/stat_variation5.tmp");