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