Lines Matching refs:file

2 Test symlink(), linkinfo(), link() and is_link() functions : usage variations - access/update file
15 Description: Tells whether the given file is a symbolic link.
24 /* Variation 4 : Create file and a hard link to the file
25 Access data of the file through the hard link
26 Update the file through hard link
27 Check size of file and hard link
31 echo "*** Accessing and updating data of file through hard link ***\n";
32 // Creating file and inserting data into it
34 // create temp file
35 $file = fopen($filename, "w");
36 // fill data into file
37 fwrite($file, str_repeat("text", 20) );
38 fclose($file);
40 echo "\n-- Access data of the file through the hard link --\n";
41 // create hard link to file
47 echo "\n-- Check size of hard link and file --\n";
49 echo "\nSize of file and hard link are same\n";
51 echo "\nWarning: Size of file and hard link differ\n";
53 echo "\n-- Updating file with data through hard link --\n";
59 // now check temp file for data; it should append "Hello World"
63 echo "\n-- Check size of hard link and file --\n";
65 echo "\nSize of file and hard link are same\n";
67 echo "\nWarning: Size of file and hard link differ\n";
69 echo "\n-- Updating file with data and check data through hard link --\n";
70 // write to temp file
71 $file = fopen($filename, "w");
72 fwrite($file, "Hello World");
73 fclose($file);
79 echo "\n-- Check size of hard link and file --\n";
83 echo "\nSize of file and hard link are same\n";
85 echo "\nWarning: Size of file and hard link differ\n";
89 // delete the temporary file
95 *** Accessing and updating data of file through hard link ***
97 -- Access data of the file through the hard link --
101 -- Check size of hard link and file --
103 Size of file and hard link are same
105 -- Updating file with data through hard link --
108 -- Check size of hard link and file --
110 Size of file and hard link are same
112 -- Updating file with data and check data through hard link --
115 -- Check size of hard link and file --
119 Size of file and hard link are same