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