1--TEST--
2Test lstat() and stat() functions: usage variations - hardlink
3--SKIPIF--
4<?php
5if (substr(PHP_OS, 0, 3) == 'WIN') {
6   die('skip.. lstat() not available on Windows');
7}
8?>
9--FILE--
10<?php
11/* Prototype: array lstat ( string $filename );
12   Description: Gives information about a file or symbolic link
13
14   Prototype: array stat ( string $filename );
15   Description: Gives information about a file
16*/
17
18/* test the effects of is_link() on stats of hard link */
19
20$file_path = dirname(__FILE__);
21require "$file_path/file.inc";
22
23
24/* create temp file & link */
25$filename = "$file_path/lstat_stat_variation14.tmp";
26$fp = fopen($filename, "w");  // temp file
27fclose($fp);
28
29echo "*** Checking lstat() and stat() on hard link ***\n";
30$linkname = "$file_path/lstat_stat_variation14_hard.tmp";
31//ensure that link doesn't exists
32@unlink($linkname);
33
34// create the link
35var_dump( link($filename, $linkname) );
36$file_stat = stat($filename);
37$link_stat = lstat($linkname);
38// compare self stats
39var_dump( compare_self_stat($file_stat) );
40var_dump( compare_self_stat($link_stat) );
41// compare the stat
42var_dump( compare_stats($file_stat, $link_stat, $all_stat_keys) );
43// clear the stat
44clearstatcache();
45
46echo "\n--- Done ---";
47?>
48
49--CLEAN--
50<?php
51$file_path = dirname(__FILE__);
52unlink("$file_path/lstat_stat_variation14_hard.tmp");
53unlink("$file_path/lstat_stat_variation14.tmp");
54?>
55--EXPECTF--
56*** Checking lstat() and stat() on hard link ***
57bool(true)
58bool(true)
59bool(true)
60bool(true)
61
62--- Done ---
63