Lines Matching refs:file

2 Test symlink(), linkinfo(), link() and is_link() functions : usage variations - access/update file
5 /* Variation 4 : Create file and a hard link to the file
6 Access data of the file through the hard link
7 Update the file through hard link
8 Check size of file and hard link
12 echo "*** Accessing and updating data of file through hard link ***\n";
13 // Creating file and inserting data into it
15 // create temp file
16 $file = fopen($filename, "w");
17 // fill data into file
18 fwrite($file, str_repeat("text", 20) );
19 fclose($file);
21 echo "\n-- Access data of the file through the hard link --\n";
22 // create hard link to file
28 echo "\n-- Check size of hard link and file --\n";
30 echo "\nSize of file and hard link are same\n";
32 echo "\nWarning: Size of file and hard link differ\n";
34 echo "\n-- Updating file with data through hard link --\n";
40 // now check temp file for data; it should append "Hello World"
44 echo "\n-- Check size of hard link and file --\n";
46 echo "\nSize of file and hard link are same\n";
48 echo "\nWarning: Size of file and hard link differ\n";
50 echo "\n-- Updating file with data and check data through hard link --\n";
51 // write to temp file
52 $file = fopen($filename, "w");
53 fwrite($file, "Hello World");
54 fclose($file);
60 echo "\n-- Check size of hard link and file --\n";
64 echo "\nSize of file and hard link are same\n";
66 echo "\nWarning: Size of file and hard link differ\n";
70 // delete the temporary file
76 *** Accessing and updating data of file through hard link ***
78 -- Access data of the file through the hard link --
82 -- Check size of hard link and file --
84 Size of file and hard link are same
86 -- Updating file with data through hard link --
89 -- Check size of hard link and file --
91 Size of file and hard link are same
93 -- Updating file with data and check data through hard link --
96 -- Check size of hard link and file --
100 Size of file and hard link are same