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