Lines Matching refs:file

2 Test fread() function : usage variations - read beyond file size, read/write 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_variation3.tmp"; // this is name of the file created by crea…
75 echo "Error: failed to fopen() file: $filename!";
86 // read file by giving size more than its size
94 echo "-- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --\n";
95 // try fread when file pointer at end
97 //reading file when file pointer at end
102 // now close the file
105 // delete the file created
106 delete_file($filename); // delete file
115 -- Testing fread() with file having content of type numeric --
120 Reading 1030 bytes from file, expecting 1024 bytes ... OK
124 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
127 Reading 10 bytes from file, expecting 0 bytes ... OK
134 Reading 1030 bytes from file, expecting 1024 bytes ... OK
138 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
141 Reading 10 bytes from file, expecting 0 bytes ... OK
148 Reading 1030 bytes from file, expecting 1024 bytes ... OK
152 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
155 Reading 10 bytes from file, expecting 0 bytes ... OK
162 Reading 1030 bytes from file, expecting 1024 bytes ... OK
166 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
169 Reading 10 bytes from file, expecting 0 bytes ... OK
176 Reading 1030 bytes from file, expecting 1024 bytes ... OK
180 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
183 Reading 10 bytes from file, expecting 0 bytes ... OK
190 Reading 1030 bytes from file, expecting 1024 bytes ... OK
194 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
197 Reading 10 bytes from file, expecting 0 bytes ... OK
204 Reading 1030 bytes from file, expecting 1024 bytes ... OK
208 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
211 Reading 10 bytes from file, expecting 0 bytes ... OK
218 Reading 1030 bytes from file, expecting 1024 bytes ... OK
222 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
225 Reading 10 bytes from file, expecting 0 bytes ... OK
232 Reading 1030 bytes from file, expecting 1024 bytes ... OK
236 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
239 Reading 10 bytes from file, expecting 0 bytes ... OK
243 -- Testing fread() with file having content of type text --
248 Reading 1030 bytes from file, expecting 1024 bytes ... OK
252 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
255 Reading 10 bytes from file, expecting 0 bytes ... OK
262 Reading 1030 bytes from file, expecting 1024 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 1024 bytes ... OK
280 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
283 Reading 10 bytes from file, expecting 0 bytes ... OK
290 Reading 1030 bytes from file, expecting 1024 bytes ... OK
294 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
297 Reading 10 bytes from file, expecting 0 bytes ... OK
304 Reading 1030 bytes from file, expecting 1024 bytes ... OK
308 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
311 Reading 10 bytes from file, expecting 0 bytes ... OK
318 Reading 1030 bytes from file, expecting 1024 bytes ... OK
322 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
325 Reading 10 bytes from file, expecting 0 bytes ... OK
332 Reading 1030 bytes from file, expecting 1024 bytes ... OK
336 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
339 Reading 10 bytes from file, expecting 0 bytes ... OK
346 Reading 1030 bytes from file, expecting 1024 bytes ... OK
350 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
353 Reading 10 bytes from file, expecting 0 bytes ... OK
360 Reading 1030 bytes from file, expecting 1024 bytes ... OK
364 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
367 Reading 10 bytes from file, expecting 0 bytes ... OK
371 -- Testing fread() with file having content of type text_with_new_line --
376 Reading 1030 bytes from file, expecting 1024 bytes ... OK
380 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
383 Reading 10 bytes from file, expecting 0 bytes ... OK
390 Reading 1030 bytes from file, expecting 1024 bytes ... OK
394 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
397 Reading 10 bytes from file, expecting 0 bytes ... OK
404 Reading 1030 bytes from file, expecting 1024 bytes ... OK
408 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
411 Reading 10 bytes from file, expecting 0 bytes ... OK
418 Reading 1030 bytes from file, expecting 1024 bytes ... OK
422 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
425 Reading 10 bytes from file, expecting 0 bytes ... OK
432 Reading 1030 bytes from file, expecting 1024 bytes ... OK
436 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
439 Reading 10 bytes from file, expecting 0 bytes ... OK
446 Reading 1030 bytes from file, expecting 1024 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 1024 bytes ... OK
464 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
467 Reading 10 bytes from file, expecting 0 bytes ... OK
474 Reading 1030 bytes from file, expecting 1024 bytes ... OK
478 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
481 Reading 10 bytes from file, expecting 0 bytes ... OK
488 Reading 1030 bytes from file, expecting 1024 bytes ... OK
492 -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
495 Reading 10 bytes from file, expecting 0 bytes ... OK