Lines Matching refs:file

2 Test symlink(), linkinfo(), link() and is_link() functions : usage variations - access/update file
9 Description: Tells whether the given file is a symbolic link.
18 /* Variation 4 : Create file and a hard link to the file
19 Access data of the file through the hard link
20 Update the file through hard link
21 Check size of file and hard link
25 echo "*** Accessing and updating data of file through hard link ***\n";
26 // Creating file and inserting data into it
28 // create temp file
29 $file = fopen($filename, "w");
30 // fill data into file
31 fwrite($file, str_repeat("text", 20) );
32 fclose($file);
34 echo "\n-- Access data of the file through the hard link --\n";
35 // create hard link to file
41 echo "\n-- Check size of hard link and file --\n";
43 echo "\nSize of file and hard link are same\n";
45 echo "\nWarning: Size of file and hard link differ\n";
47 echo "\n-- Updating file with data through hard link --\n";
53 // now check temp file for data; it should append "Hello World"
57 echo "\n-- Check size of hard link and file --\n";
59 echo "\nSize of file and hard link are same\n";
61 echo "\nWarning: Size of file and hard link differ\n";
63 echo "\n-- Updating file with data and check data through hard link --\n";
64 // write to temp file
65 $file = fopen($filename, "w");
66 fwrite($file, "Hello World");
67 fclose($file);
73 echo "\n-- Check size of hard link and file --\n";
77 echo "\nSize of file and hard link are same\n";
79 echo "\nWarning: Size of file and hard link differ\n";
83 // delete the temporary file
89 *** Accessing and updating data of file through hard link ***
91 -- Access data of the file through the hard link --
95 -- Check size of hard link and file --
97 Size of file and hard link are same
99 -- Updating file with data through hard link --
102 -- Check size of hard link and file --
104 Size of file and hard link are same
106 -- Updating file with data and check data through hard link --
109 -- Check size of hard link and file --
113 Size of file and hard link are same