Lines Matching refs:file

2 Test fread() function : usage variations - read beyond file size, write only mode
13 Description: reads up to length bytes from the file pointer referenced by handle.
14 Reading stops when up to length bytes have been read, EOF (end of file) is
19 // include the file.inc for common functions for test
20 include ("file.inc");
23 Description : Read data from file of size $read_size and verifies that $expected_size no. of
31 // print file pointer position before read
36 echo "Reading $read_size bytes from file, expecting $expect_size bytes ... ";
43 echo "Error reading file, total number of bytes read = ".strlen($data_from_file)."\n";
45 // file pointer position after read
47 // check if file pointer at eof()
62 echo "\n-- Testing fread() with file having content of type ". $file_content_type ." --\n";
64 /* open the file using $files_modes and perform fread() on it */
71 …$filename = dirname(__FILE__)."/fread_variation4.tmp"; // this is name of the file created by crea…
75 echo "Error: failed to fopen() file: $filename!";
85 // read file by giving size more than its size
91 echo "-- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --\n";
93 // try fread when file pointer at end
95 //reading file when file pointer at end
100 // now close the file
103 // delete the file created
104 delete_file($filename); // delete file
113 -- Testing fread() with file having content of type numeric --
118 Reading 1030 bytes from file, expecting 0 bytes ... OK
121 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
124 Reading 10 bytes from file, expecting 0 bytes ... OK
131 Reading 1030 bytes from file, expecting 0 bytes ... OK
134 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
137 Reading 10 bytes from file, expecting 0 bytes ... OK
144 Reading 1030 bytes from file, expecting 0 bytes ... OK
147 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
150 Reading 10 bytes from file, expecting 0 bytes ... OK
157 Reading 1030 bytes from file, expecting 0 bytes ... OK
160 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
163 Reading 10 bytes from file, expecting 0 bytes ... OK
170 Reading 1030 bytes from file, expecting 0 bytes ... OK
173 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
176 Reading 10 bytes from file, expecting 0 bytes ... OK
183 Reading 1030 bytes from file, expecting 0 bytes ... OK
186 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
189 Reading 10 bytes from file, expecting 0 bytes ... OK
196 Reading 1030 bytes from file, expecting 0 bytes ... OK
199 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
202 Reading 10 bytes from file, expecting 0 bytes ... OK
209 Reading 1030 bytes from file, expecting 0 bytes ... OK
212 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
215 Reading 10 bytes from file, expecting 0 bytes ... OK
222 Reading 1030 bytes from file, expecting 0 bytes ... OK
225 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
228 Reading 10 bytes from file, expecting 0 bytes ... OK
232 -- Testing fread() with file having content of type text --
237 Reading 1030 bytes from file, expecting 0 bytes ... OK
240 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
243 Reading 10 bytes from file, expecting 0 bytes ... OK
250 Reading 1030 bytes from file, expecting 0 bytes ... OK
253 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
256 Reading 10 bytes from file, expecting 0 bytes ... OK
263 Reading 1030 bytes from file, expecting 0 bytes ... OK
266 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
269 Reading 10 bytes from file, expecting 0 bytes ... OK
276 Reading 1030 bytes from file, expecting 0 bytes ... OK
279 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
282 Reading 10 bytes from file, expecting 0 bytes ... OK
289 Reading 1030 bytes from file, expecting 0 bytes ... OK
292 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
295 Reading 10 bytes from file, expecting 0 bytes ... OK
302 Reading 1030 bytes from file, expecting 0 bytes ... OK
305 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
308 Reading 10 bytes from file, expecting 0 bytes ... OK
315 Reading 1030 bytes from file, expecting 0 bytes ... OK
318 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
321 Reading 10 bytes from file, expecting 0 bytes ... OK
328 Reading 1030 bytes from file, expecting 0 bytes ... OK
331 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
334 Reading 10 bytes from file, expecting 0 bytes ... OK
341 Reading 1030 bytes from file, expecting 0 bytes ... OK
344 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
347 Reading 10 bytes from file, expecting 0 bytes ... OK
351 -- Testing fread() with file having content of type text_with_new_line --
356 Reading 1030 bytes from file, expecting 0 bytes ... OK
359 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
362 Reading 10 bytes from file, expecting 0 bytes ... OK
369 Reading 1030 bytes from file, expecting 0 bytes ... OK
372 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
375 Reading 10 bytes from file, expecting 0 bytes ... OK
382 Reading 1030 bytes from file, expecting 0 bytes ... OK
385 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
388 Reading 10 bytes from file, expecting 0 bytes ... OK
395 Reading 1030 bytes from file, expecting 0 bytes ... OK
398 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
401 Reading 10 bytes from file, expecting 0 bytes ... OK
408 Reading 1030 bytes from file, expecting 0 bytes ... OK
411 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
414 Reading 10 bytes from file, expecting 0 bytes ... OK
421 Reading 1030 bytes from file, expecting 0 bytes ... OK
424 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
427 Reading 10 bytes from file, expecting 0 bytes ... OK
434 Reading 1030 bytes from file, expecting 0 bytes ... OK
437 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
440 Reading 10 bytes from file, expecting 0 bytes ... OK
447 Reading 1030 bytes from file, expecting 0 bytes ... OK
450 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
453 Reading 10 bytes from file, expecting 0 bytes ... OK
460 Reading 1030 bytes from file, expecting 0 bytes ... OK
463 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
466 Reading 10 bytes from file, expecting 0 bytes ... OK