import zend standard tests
[hiphop-php.git] / hphp / test / zend / bad / ext-standard-file / stat_variation6-win32.php
blob4781a9fda7093d2f6b9e564f1ecbab5da567e7c9
1 <?php
3 /*
4 * Prototype: array stat ( string $filename );
5 * Description: Gives information about a file
6 */
8 /* test the effects on the stats of dir/file for changing permissions of dir/file */
11 $file_path = dirname(__FILE__);
12 require "$file_path/file.inc";
15 /* create temp file and directory */
16 $dirname = "$file_path/stat_variation6";
17 mkdir($dirname); // temp dir
19 $filename = "$file_path/stat_variation6.tmp";
20 $file_handle = fopen($filename, "w"); // temp file
21 fclose($file_handle);
24 // checking stat() on file
25 echo "\n*** Testing stat() on file with miscelleneous file permission and content ***\n";
26 $old_stat = stat($filename);
27 var_dump( chmod($filename, 0777) );
28 // clear the stat
29 clearstatcache();
30 sleep(2);
31 $new_stat = stat($filename);
32 // compare self stats
33 var_dump( compare_self_stat($old_stat) );
34 var_dump( compare_self_stat($new_stat) );
35 // compare the stat
36 $affected_members = array( 10, 'ctime');
37 var_dump( compare_stats($old_stat, $new_stat, $affected_members, "=") );
38 // clear the stat
39 clearstatcache(); // clear statement cache
41 // checking stat() on directory
42 echo "\n*** Testing stat() on directory with miscelleneous file permission ***\n";
43 $old_stat = stat($dirname);
44 var_dump( chmod($dirname, 0777) );
45 // clear the stat
46 clearstatcache();
47 sleep(2);
48 $new_stat = stat($dirname);
49 // compare self stats
50 var_dump( compare_self_stat($old_stat) );
51 var_dump( compare_self_stat($new_stat) );
52 // compare the stat
53 $affected_members = array( 10, 'ctime');
54 var_dump( compare_stats($old_stat, $new_stat, $affected_members, "=") );
55 // clear the stat
56 clearstatcache(); // clear statement cache
59 echo "\n*** Done ***";
61 <?php
62 $file_path = dirname(__FILE__);
63 unlink("$file_path/stat_variation6.tmp");
64 rmdir("$file_path/stat_variation6");