12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- --TEST--
- Test fileperms() function: usage variations - links
- --CREDITS--
- Dave Kelsey <d_kelsey@uk.ibm.com>
- --SKIPIF--
- <?php
- if (substr(PHP_OS, 0, 3) == 'WIN') {
- die('skip Do not run on Windows');
- }
- --FILE--
- <?php
- /* Creating soft and hard links to a file and applying fileperms() on links */
- $file_path = __DIR__;
- fclose( fopen($file_path."/fileperms_variation1.tmp", "w") );
- echo "*** Testing fileperms() with links ***\n";
- /* With symlink */
- symlink($file_path."/fileperms_variation1.tmp", $file_path."/fileperms_variation1_symlink.tmp");
- var_dump( fileperms($file_path."/fileperms_variation1_symlink.tmp") ); //expected true
- clearstatcache();
- /* With hardlink */
- link($file_path."/fileperms_variation1.tmp", $file_path."/fileperms_variation1_link.tmp");
- var_dump( fileperms($file_path."/fileperms_variation1_link.tmp") ); // expected: true
- clearstatcache();
- echo "\n*** Done ***";
- ?>
- --CLEAN--
- <?php
- $file_path = __DIR__;
- unlink($file_path."/fileperms_variation1_symlink.tmp");
- unlink($file_path."/fileperms_variation1_link.tmp");
- unlink($file_path."/fileperms_variation1.tmp");
- ?>
- --EXPECTF--
- *** Testing fileperms() with links ***
- int(%d)
- int(%d)
- *** Done ***
|