1--TEST-- 2Test fileperms() function: usage variations - links 3--CREDITS-- 4Dave Kelsey <d_kelsey@uk.ibm.com> 5--SKIPIF-- 6<?php 7if (substr(PHP_OS, 0, 3) == 'WIN') { 8 die('skip Do not run on Windows'); 9} 10--FILE-- 11<?php 12 13/* Creating soft and hard links to a file and applying fileperms() on links */ 14 15$file_path = __DIR__; 16fclose( fopen($file_path."/fileperms_variation1.tmp", "w") ); 17 18echo "*** Testing fileperms() with links ***\n"; 19/* With symlink */ 20symlink($file_path."/fileperms_variation1.tmp", $file_path."/fileperms_variation1_symlink.tmp"); 21var_dump( fileperms($file_path."/fileperms_variation1_symlink.tmp") ); //expected true 22clearstatcache(); 23 24/* With hardlink */ 25link($file_path."/fileperms_variation1.tmp", $file_path."/fileperms_variation1_link.tmp"); 26var_dump( fileperms($file_path."/fileperms_variation1_link.tmp") ); // expected: true 27clearstatcache(); 28 29echo "\n*** Done ***"; 30?> 31--CLEAN-- 32<?php 33$file_path = __DIR__; 34unlink($file_path."/fileperms_variation1_symlink.tmp"); 35unlink($file_path."/fileperms_variation1_link.tmp"); 36unlink($file_path."/fileperms_variation1.tmp"); 37?> 38--EXPECTF-- 39*** Testing fileperms() with links *** 40int(%d) 41int(%d) 42 43*** Done *** 44