1--TEST--
2Test fileowner() 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 fileowner() on links */
15
16$file_path = __DIR__;
17fclose( fopen($file_path."/fileowner_variation1.tmp", "w") );
18
19echo "*** Testing fileowner() with links ***\n";
20/* With symlink */
21symlink($file_path."/fileowner_variation1.tmp", $file_path."/fileowner_variation1_symlink.tmp");
22var_dump( fileowner($file_path."/fileowner_variation1_symlink.tmp") ); //expected true
23clearstatcache();
24
25/* With hardlink */
26link($file_path."/fileowner_variation1.tmp", $file_path."/fileowner_variation1_link.tmp");
27var_dump( fileowner($file_path."/fileowner_variation1_link.tmp") );  // expected: true
28clearstatcache();
29
30echo "\n*** Done ***";
31?>
32--CLEAN--
33<?php
34$file_path = __DIR__;
35unlink($file_path."/fileowner_variation1_symlink.tmp");
36unlink($file_path."/fileowner_variation1_link.tmp");
37unlink($file_path."/fileowner_variation1.tmp");
38?>
39--EXPECTF--
40*** Testing fileowner() with links ***
41int(%d)
42int(%d)
43
44*** Done ***
45