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