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/* Prototype: int fileowner ( string $filename )
13 * Description: Returns the user ID of the owner of the file, or
14 *              FALSE in case of an error.
15 */
16
17/* Creating soft and hard links to a file and applying fileowner() on links */
18
19$file_path = dirname(__FILE__);
20fclose( fopen($file_path."/fileowner_variation1.tmp", "w") );
21
22echo "*** Testing fileowner() with links ***\n";
23/* With symlink */
24symlink($file_path."/fileowner_variation1.tmp", $file_path."/fileowner_variation1_symlink.tmp");
25var_dump( fileowner($file_path."/fileowner_variation1_symlink.tmp") ); //expected true
26clearstatcache();
27
28/* With hardlink */
29link($file_path."/fileowner_variation1.tmp", $file_path."/fileowner_variation1_link.tmp");
30var_dump( fileowner($file_path."/fileowner_variation1_link.tmp") );  // expected: true
31clearstatcache();
32
33echo "\n*** Done ***";
34?>
35--CLEAN--
36<?php
37$file_path = dirname(__FILE__);
38unlink($file_path."/fileowner_variation1_symlink.tmp");
39unlink($file_path."/fileowner_variation1_link.tmp");
40unlink($file_path."/fileowner_variation1.tmp");
41?>
42
43--EXPECTF--
44*** Testing fileowner() with links ***
45int(%d)
46int(%d)
47
48*** Done ***
49