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?>
11--FILE--
12<?php
13
14/* Creating soft and hard links to a file and applying fileperms() on links */
15
16$file_path = __DIR__;
17fclose( fopen($file_path."/fileperms_variation1.tmp", "w") );
18
19echo "*** Testing fileperms() with links ***\n";
20/* With symlink */
21symlink($file_path."/fileperms_variation1.tmp", $file_path."/fileperms_variation1_symlink.tmp");
22var_dump( fileperms($file_path."/fileperms_variation1_symlink.tmp") ); //expected true
23clearstatcache();
24
25/* With hardlink */
26link($file_path."/fileperms_variation1.tmp", $file_path."/fileperms_variation1_link.tmp");
27var_dump( fileperms($file_path."/fileperms_variation1_link.tmp") );  // expected: true
28clearstatcache();
29
30echo "\n*** Done ***";
31?>
32--CLEAN--
33<?php
34$file_path = __DIR__;
35unlink($file_path."/fileperms_variation1_symlink.tmp");
36unlink($file_path."/fileperms_variation1_link.tmp");
37unlink($file_path."/fileperms_variation1.tmp");
38?>
39--EXPECTF--
40*** Testing fileperms() with links ***
41int(%d)
42int(%d)
43
44*** Done ***
45