Annotation of embedaddon/php/ext/standard/tests/file/fileinode_variation1.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test fileinode() function: usage variations - links
3: --CREDITS--
4: Dave Kelsey <d_kelsey@uk.ibm.com>
5: --SKIPIF--
6: <?php
7: if (substr(PHP_OS, 0, 3) == 'WIN') {
8: die('skip Do not run on Windows');
9: }
10: --FILE--
11: <?php
12: /*
13: Prototype: int fileinode ( string $filename );
14: Description: 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 = dirname(__FILE__);
20: fclose( fopen($file_path."/fileinode_variation1.tmp", "w") );
21:
22: echo "*** Testing fileinode() with links ***\n";
23: /* With symlink */
24: symlink($file_path."/fileinode_variation1.tmp", $file_path."/fileinode_variation1_symlink.tmp");
25: var_dump( fileinode($file_path."/fileinode_variation1_symlink.tmp") ); //expected true
26: clearstatcache();
27:
28: /* With hardlink */
29: link($file_path."/fileinode_variation1.tmp", $file_path."/fileinode_variation1_link.tmp");
30: var_dump( fileinode($file_path."/fileinode_variation1_link.tmp") ); // expected: true
31: clearstatcache();
32:
33: echo "\n*** Done ***";
34: ?>
35: --CLEAN--
36: <?php
37: $file_path = dirname(__FILE__);
38: unlink($file_path."/fileinode_variation1_symlink.tmp");
39: unlink($file_path."/fileinode_variation1_link.tmp");
40: unlink($file_path."/fileinode_variation1.tmp");
41: ?>
42:
43: --EXPECTF--
44: *** Testing fileinode() with links ***
45: int(%d)
46: int(%d)
47:
48: *** Done ***
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>