Return to fileperms_variation1.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / file |
1.1 misho 1: --TEST-- 2: Test fileperms() function: usage variations - links 3: --CREDITS-- 4: Dave Kelsey <d_kelsey@uk.ibm.com> 5: --SKIPIF-- 6: <?php 7: if (substr(PHP_OS, 0, 3) == 'WIN') { 8: die('skip Do not run on Windows'); 9: } 10: --FILE-- 11: <?php 12: /* Prototype: int fileperms ( string $filename ) 13: * Description: Returns the group ID of the file, or FALSE in case of an error. 14: */ 15: 16: /* Creating soft and hard links to a file and applying fileperms() on links */ 17: 18: $file_path = dirname(__FILE__); 19: fclose( fopen($file_path."/fileperms_variation1.tmp", "w") ); 20: 21: echo "*** Testing fileperms() with links ***\n"; 22: /* With symlink */ 23: symlink($file_path."/fileperms_variation1.tmp", $file_path."/fileperms_variation1_symlink.tmp"); 24: var_dump( fileperms($file_path."/fileperms_variation1_symlink.tmp") ); //expected true 25: clearstatcache(); 26: 27: /* With hardlink */ 28: link($file_path."/fileperms_variation1.tmp", $file_path."/fileperms_variation1_link.tmp"); 29: var_dump( fileperms($file_path."/fileperms_variation1_link.tmp") ); // expected: true 30: clearstatcache(); 31: 32: echo "\n*** Done ***"; 33: ?> 34: --CLEAN-- 35: <?php 36: $file_path = dirname(__FILE__); 37: unlink($file_path."/fileperms_variation1_symlink.tmp"); 38: unlink($file_path."/fileperms_variation1_link.tmp"); 39: unlink($file_path."/fileperms_variation1.tmp"); 40: ?> 41: 42: --EXPECTF-- 43: *** Testing fileperms() with links *** 44: int(%d) 45: int(%d) 46: 47: *** Done ***