1--TEST--
2Test fread() function : usage variations - read some/all chars, write only mode (Bug #42036)
3--FILE--
4<?php
5/*
6 Prototype: string fread ( resource $handle [, int $length] );
7 Description: reads up to length bytes from the file pointer referenced by handle.
8   Reading stops when up to length bytes have been read, EOF (end of file) is
9   reached, (for network streams) when a packet becomes available, or (after
10   opening userspace stream) when 8192 bytes have been read whichever comes first.
11*/
12
13/* Try reading some or all content of the file opened in write only mode */
14
15// include the file.inc for common functions for test
16include ("file.inc");
17
18/* Function : function check_read(resource $file_handle, int $read_size, int $expect_size)
19   Description : Read data from file of size $read_size and verifies that $expected_size no. of
20                 bytes are read.
21     $file_handle : File Handle
22     $read_size   : No. of bytes to be read.
23     $expect_size : Expected data length
24   Returns: returns the data read
25*/
26function check_read($file_handle, $read_size, $expect_size) {
27  // print file pointer position before read
28  var_dump( ftell($file_handle) );
29  var_dump( feof($file_handle) );
30
31  // read the data of size $read_size
32  echo "Reading $read_size bytes from file, expecting $expect_size bytes ... ";
33  $data_from_file = fread($file_handle, $read_size);
34
35  // check if data read is of expected size
36  if ( strlen($data_from_file) == $expect_size)
37    echo "OK\n";
38  else
39    echo "Error reading file, total number of bytes read = ".strlen($data_from_file)."\n";
40
41  // file pointer position after read
42  var_dump( ftell($file_handle) );
43  // check if file pointer at eof()
44  var_dump( feof($file_handle) );
45  echo "\n";
46
47  return $data_from_file;
48}
49
50echo "*** Testing fread() : usage variations ***\n";
51
52$file_modes = array("a","ab","at",
53                    "w","wb","wt",
54                    "x","xb","xt" );
55
56$file_content_types = array("numeric","text","text_with_new_line", "alphanumeric");
57
58foreach($file_content_types as $file_content_type) {
59  echo "\n-- Testing fread() with file having content of type ". $file_content_type ." --\n";
60
61  /* open the file using $files_modes and perform fread() on it */
62  foreach($file_modes as $file_mode) {
63    if(!strstr($file_mode,"x")){
64       /* create files with $file_content_type */
65       create_files ( __DIR__, 1, $file_content_type, 0755, 1, "w", "fread_variation", 2);
66    }
67
68    $filename = __DIR__."/fread_variation2.tmp"; // this is name of the file created by create_files()
69    echo "-- File opened in mode ".$file_mode." --\n";
70    $file_handle = fopen($filename, $file_mode);
71    if (!$file_handle) {
72       echo "Error: failed to fopen() file: $filename!";
73       exit();
74    }
75
76    if(strstr($file_mode,"w") || strstr($file_mode,"x") ) {
77      fill_file($file_handle, $file_content_type, 1024);
78    }
79
80    rewind($file_handle);
81    echo "-- Reading entire file content, expeceted : 0 bytes --\n";
82    // read from file, by giving the file actual size,
83    $data_from_file = check_read($file_handle, 1024, (strstr($file_mode, "+") ? 1024 : 0 ) );
84    // calculate the hash and dump it, if data read, expecting here no data was read
85    if ( $data_from_file != false)
86      var_dump( md5($data_from_file) );
87
88    // reading file by giving less than its size
89    echo "-- Reading file content less than max. file size, expeceted : 0 bytes --\n";
90    rewind($file_handle);
91    $data_from_file = check_read($file_handle, 1000, (strstr($file_mode, "+") ? 1000 : 0 ) );
92    // calculate the hash and dump it, if data read, expecting here no data was read
93    if ( $data_from_file != false)
94      var_dump( md5($data_from_file) );
95
96    // now close the file
97    fclose($file_handle);
98
99    // delete the file created
100    delete_file($filename); // delete file
101  } // end of inner foreach loop
102}// end of outer foreach loop
103
104echo "Done\n";
105?>
106--EXPECTF--
107*** Testing fread() : usage variations ***
108
109-- Testing fread() with file having content of type numeric --
110-- File opened in mode a --
111-- Reading entire file content, expeceted : 0 bytes --
112int(0)
113bool(false)
114Reading 1024 bytes from file, expecting 0 bytes ...
115Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
116OK
117int(0)
118bool(false)
119
120-- Reading file content less than max. file size, expeceted : 0 bytes --
121int(0)
122bool(false)
123Reading 1000 bytes from file, expecting 0 bytes ...
124Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
125OK
126int(0)
127bool(false)
128
129-- File opened in mode ab --
130-- Reading entire file content, expeceted : 0 bytes --
131int(0)
132bool(false)
133Reading 1024 bytes from file, expecting 0 bytes ...
134Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
135OK
136int(0)
137bool(false)
138
139-- Reading file content less than max. file size, expeceted : 0 bytes --
140int(0)
141bool(false)
142Reading 1000 bytes from file, expecting 0 bytes ...
143Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
144OK
145int(0)
146bool(false)
147
148-- File opened in mode at --
149-- Reading entire file content, expeceted : 0 bytes --
150int(0)
151bool(false)
152Reading 1024 bytes from file, expecting 0 bytes ...
153Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
154OK
155int(0)
156bool(false)
157
158-- Reading file content less than max. file size, expeceted : 0 bytes --
159int(0)
160bool(false)
161Reading 1000 bytes from file, expecting 0 bytes ...
162Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
163OK
164int(0)
165bool(false)
166
167-- File opened in mode w --
168-- Reading entire file content, expeceted : 0 bytes --
169int(0)
170bool(false)
171Reading 1024 bytes from file, expecting 0 bytes ...
172Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
173OK
174int(0)
175bool(false)
176
177-- Reading file content less than max. file size, expeceted : 0 bytes --
178int(0)
179bool(false)
180Reading 1000 bytes from file, expecting 0 bytes ...
181Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
182OK
183int(0)
184bool(false)
185
186-- File opened in mode wb --
187-- Reading entire file content, expeceted : 0 bytes --
188int(0)
189bool(false)
190Reading 1024 bytes from file, expecting 0 bytes ...
191Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
192OK
193int(0)
194bool(false)
195
196-- Reading file content less than max. file size, expeceted : 0 bytes --
197int(0)
198bool(false)
199Reading 1000 bytes from file, expecting 0 bytes ...
200Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
201OK
202int(0)
203bool(false)
204
205-- File opened in mode wt --
206-- Reading entire file content, expeceted : 0 bytes --
207int(0)
208bool(false)
209Reading 1024 bytes from file, expecting 0 bytes ...
210Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
211OK
212int(0)
213bool(false)
214
215-- Reading file content less than max. file size, expeceted : 0 bytes --
216int(0)
217bool(false)
218Reading 1000 bytes from file, expecting 0 bytes ...
219Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
220OK
221int(0)
222bool(false)
223
224-- File opened in mode x --
225-- Reading entire file content, expeceted : 0 bytes --
226int(0)
227bool(false)
228Reading 1024 bytes from file, expecting 0 bytes ...
229Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
230OK
231int(0)
232bool(false)
233
234-- Reading file content less than max. file size, expeceted : 0 bytes --
235int(0)
236bool(false)
237Reading 1000 bytes from file, expecting 0 bytes ...
238Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
239OK
240int(0)
241bool(false)
242
243-- File opened in mode xb --
244-- Reading entire file content, expeceted : 0 bytes --
245int(0)
246bool(false)
247Reading 1024 bytes from file, expecting 0 bytes ...
248Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
249OK
250int(0)
251bool(false)
252
253-- Reading file content less than max. file size, expeceted : 0 bytes --
254int(0)
255bool(false)
256Reading 1000 bytes from file, expecting 0 bytes ...
257Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
258OK
259int(0)
260bool(false)
261
262-- File opened in mode xt --
263-- Reading entire file content, expeceted : 0 bytes --
264int(0)
265bool(false)
266Reading 1024 bytes from file, expecting 0 bytes ...
267Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
268OK
269int(0)
270bool(false)
271
272-- Reading file content less than max. file size, expeceted : 0 bytes --
273int(0)
274bool(false)
275Reading 1000 bytes from file, expecting 0 bytes ...
276Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
277OK
278int(0)
279bool(false)
280
281
282-- Testing fread() with file having content of type text --
283-- File opened in mode a --
284-- Reading entire file content, expeceted : 0 bytes --
285int(0)
286bool(false)
287Reading 1024 bytes from file, expecting 0 bytes ...
288Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
289OK
290int(0)
291bool(false)
292
293-- Reading file content less than max. file size, expeceted : 0 bytes --
294int(0)
295bool(false)
296Reading 1000 bytes from file, expecting 0 bytes ...
297Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
298OK
299int(0)
300bool(false)
301
302-- File opened in mode ab --
303-- Reading entire file content, expeceted : 0 bytes --
304int(0)
305bool(false)
306Reading 1024 bytes from file, expecting 0 bytes ...
307Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
308OK
309int(0)
310bool(false)
311
312-- Reading file content less than max. file size, expeceted : 0 bytes --
313int(0)
314bool(false)
315Reading 1000 bytes from file, expecting 0 bytes ...
316Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
317OK
318int(0)
319bool(false)
320
321-- File opened in mode at --
322-- Reading entire file content, expeceted : 0 bytes --
323int(0)
324bool(false)
325Reading 1024 bytes from file, expecting 0 bytes ...
326Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
327OK
328int(0)
329bool(false)
330
331-- Reading file content less than max. file size, expeceted : 0 bytes --
332int(0)
333bool(false)
334Reading 1000 bytes from file, expecting 0 bytes ...
335Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
336OK
337int(0)
338bool(false)
339
340-- File opened in mode w --
341-- Reading entire file content, expeceted : 0 bytes --
342int(0)
343bool(false)
344Reading 1024 bytes from file, expecting 0 bytes ...
345Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
346OK
347int(0)
348bool(false)
349
350-- Reading file content less than max. file size, expeceted : 0 bytes --
351int(0)
352bool(false)
353Reading 1000 bytes from file, expecting 0 bytes ...
354Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
355OK
356int(0)
357bool(false)
358
359-- File opened in mode wb --
360-- Reading entire file content, expeceted : 0 bytes --
361int(0)
362bool(false)
363Reading 1024 bytes from file, expecting 0 bytes ...
364Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
365OK
366int(0)
367bool(false)
368
369-- Reading file content less than max. file size, expeceted : 0 bytes --
370int(0)
371bool(false)
372Reading 1000 bytes from file, expecting 0 bytes ...
373Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
374OK
375int(0)
376bool(false)
377
378-- File opened in mode wt --
379-- Reading entire file content, expeceted : 0 bytes --
380int(0)
381bool(false)
382Reading 1024 bytes from file, expecting 0 bytes ...
383Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
384OK
385int(0)
386bool(false)
387
388-- Reading file content less than max. file size, expeceted : 0 bytes --
389int(0)
390bool(false)
391Reading 1000 bytes from file, expecting 0 bytes ...
392Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
393OK
394int(0)
395bool(false)
396
397-- File opened in mode x --
398-- Reading entire file content, expeceted : 0 bytes --
399int(0)
400bool(false)
401Reading 1024 bytes from file, expecting 0 bytes ...
402Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
403OK
404int(0)
405bool(false)
406
407-- Reading file content less than max. file size, expeceted : 0 bytes --
408int(0)
409bool(false)
410Reading 1000 bytes from file, expecting 0 bytes ...
411Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
412OK
413int(0)
414bool(false)
415
416-- File opened in mode xb --
417-- Reading entire file content, expeceted : 0 bytes --
418int(0)
419bool(false)
420Reading 1024 bytes from file, expecting 0 bytes ...
421Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
422OK
423int(0)
424bool(false)
425
426-- Reading file content less than max. file size, expeceted : 0 bytes --
427int(0)
428bool(false)
429Reading 1000 bytes from file, expecting 0 bytes ...
430Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
431OK
432int(0)
433bool(false)
434
435-- File opened in mode xt --
436-- Reading entire file content, expeceted : 0 bytes --
437int(0)
438bool(false)
439Reading 1024 bytes from file, expecting 0 bytes ...
440Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
441OK
442int(0)
443bool(false)
444
445-- Reading file content less than max. file size, expeceted : 0 bytes --
446int(0)
447bool(false)
448Reading 1000 bytes from file, expecting 0 bytes ...
449Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
450OK
451int(0)
452bool(false)
453
454
455-- Testing fread() with file having content of type text_with_new_line --
456-- File opened in mode a --
457-- Reading entire file content, expeceted : 0 bytes --
458int(0)
459bool(false)
460Reading 1024 bytes from file, expecting 0 bytes ...
461Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
462OK
463int(0)
464bool(false)
465
466-- Reading file content less than max. file size, expeceted : 0 bytes --
467int(0)
468bool(false)
469Reading 1000 bytes from file, expecting 0 bytes ...
470Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
471OK
472int(0)
473bool(false)
474
475-- File opened in mode ab --
476-- Reading entire file content, expeceted : 0 bytes --
477int(0)
478bool(false)
479Reading 1024 bytes from file, expecting 0 bytes ...
480Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
481OK
482int(0)
483bool(false)
484
485-- Reading file content less than max. file size, expeceted : 0 bytes --
486int(0)
487bool(false)
488Reading 1000 bytes from file, expecting 0 bytes ...
489Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
490OK
491int(0)
492bool(false)
493
494-- File opened in mode at --
495-- Reading entire file content, expeceted : 0 bytes --
496int(0)
497bool(false)
498Reading 1024 bytes from file, expecting 0 bytes ...
499Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
500OK
501int(0)
502bool(false)
503
504-- Reading file content less than max. file size, expeceted : 0 bytes --
505int(0)
506bool(false)
507Reading 1000 bytes from file, expecting 0 bytes ...
508Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
509OK
510int(0)
511bool(false)
512
513-- File opened in mode w --
514-- Reading entire file content, expeceted : 0 bytes --
515int(0)
516bool(false)
517Reading 1024 bytes from file, expecting 0 bytes ...
518Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
519OK
520int(0)
521bool(false)
522
523-- Reading file content less than max. file size, expeceted : 0 bytes --
524int(0)
525bool(false)
526Reading 1000 bytes from file, expecting 0 bytes ...
527Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
528OK
529int(0)
530bool(false)
531
532-- File opened in mode wb --
533-- Reading entire file content, expeceted : 0 bytes --
534int(0)
535bool(false)
536Reading 1024 bytes from file, expecting 0 bytes ...
537Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
538OK
539int(0)
540bool(false)
541
542-- Reading file content less than max. file size, expeceted : 0 bytes --
543int(0)
544bool(false)
545Reading 1000 bytes from file, expecting 0 bytes ...
546Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
547OK
548int(0)
549bool(false)
550
551-- File opened in mode wt --
552-- Reading entire file content, expeceted : 0 bytes --
553int(0)
554bool(false)
555Reading 1024 bytes from file, expecting 0 bytes ...
556Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
557OK
558int(0)
559bool(false)
560
561-- Reading file content less than max. file size, expeceted : 0 bytes --
562int(0)
563bool(false)
564Reading 1000 bytes from file, expecting 0 bytes ...
565Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
566OK
567int(0)
568bool(false)
569
570-- File opened in mode x --
571-- Reading entire file content, expeceted : 0 bytes --
572int(0)
573bool(false)
574Reading 1024 bytes from file, expecting 0 bytes ...
575Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
576OK
577int(0)
578bool(false)
579
580-- Reading file content less than max. file size, expeceted : 0 bytes --
581int(0)
582bool(false)
583Reading 1000 bytes from file, expecting 0 bytes ...
584Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
585OK
586int(0)
587bool(false)
588
589-- File opened in mode xb --
590-- Reading entire file content, expeceted : 0 bytes --
591int(0)
592bool(false)
593Reading 1024 bytes from file, expecting 0 bytes ...
594Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
595OK
596int(0)
597bool(false)
598
599-- Reading file content less than max. file size, expeceted : 0 bytes --
600int(0)
601bool(false)
602Reading 1000 bytes from file, expecting 0 bytes ...
603Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
604OK
605int(0)
606bool(false)
607
608-- File opened in mode xt --
609-- Reading entire file content, expeceted : 0 bytes --
610int(0)
611bool(false)
612Reading 1024 bytes from file, expecting 0 bytes ...
613Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
614OK
615int(0)
616bool(false)
617
618-- Reading file content less than max. file size, expeceted : 0 bytes --
619int(0)
620bool(false)
621Reading 1000 bytes from file, expecting 0 bytes ...
622Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
623OK
624int(0)
625bool(false)
626
627
628-- Testing fread() with file having content of type alphanumeric --
629-- File opened in mode a --
630-- Reading entire file content, expeceted : 0 bytes --
631int(0)
632bool(false)
633Reading 1024 bytes from file, expecting 0 bytes ...
634Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
635OK
636int(0)
637bool(false)
638
639-- Reading file content less than max. file size, expeceted : 0 bytes --
640int(0)
641bool(false)
642Reading 1000 bytes from file, expecting 0 bytes ...
643Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
644OK
645int(0)
646bool(false)
647
648-- File opened in mode ab --
649-- Reading entire file content, expeceted : 0 bytes --
650int(0)
651bool(false)
652Reading 1024 bytes from file, expecting 0 bytes ...
653Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
654OK
655int(0)
656bool(false)
657
658-- Reading file content less than max. file size, expeceted : 0 bytes --
659int(0)
660bool(false)
661Reading 1000 bytes from file, expecting 0 bytes ...
662Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
663OK
664int(0)
665bool(false)
666
667-- File opened in mode at --
668-- Reading entire file content, expeceted : 0 bytes --
669int(0)
670bool(false)
671Reading 1024 bytes from file, expecting 0 bytes ...
672Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
673OK
674int(0)
675bool(false)
676
677-- Reading file content less than max. file size, expeceted : 0 bytes --
678int(0)
679bool(false)
680Reading 1000 bytes from file, expecting 0 bytes ...
681Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
682OK
683int(0)
684bool(false)
685
686-- File opened in mode w --
687-- Reading entire file content, expeceted : 0 bytes --
688int(0)
689bool(false)
690Reading 1024 bytes from file, expecting 0 bytes ...
691Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
692OK
693int(0)
694bool(false)
695
696-- Reading file content less than max. file size, expeceted : 0 bytes --
697int(0)
698bool(false)
699Reading 1000 bytes from file, expecting 0 bytes ...
700Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
701OK
702int(0)
703bool(false)
704
705-- File opened in mode wb --
706-- Reading entire file content, expeceted : 0 bytes --
707int(0)
708bool(false)
709Reading 1024 bytes from file, expecting 0 bytes ...
710Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
711OK
712int(0)
713bool(false)
714
715-- Reading file content less than max. file size, expeceted : 0 bytes --
716int(0)
717bool(false)
718Reading 1000 bytes from file, expecting 0 bytes ...
719Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
720OK
721int(0)
722bool(false)
723
724-- File opened in mode wt --
725-- Reading entire file content, expeceted : 0 bytes --
726int(0)
727bool(false)
728Reading 1024 bytes from file, expecting 0 bytes ...
729Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
730OK
731int(0)
732bool(false)
733
734-- Reading file content less than max. file size, expeceted : 0 bytes --
735int(0)
736bool(false)
737Reading 1000 bytes from file, expecting 0 bytes ...
738Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
739OK
740int(0)
741bool(false)
742
743-- File opened in mode x --
744-- Reading entire file content, expeceted : 0 bytes --
745int(0)
746bool(false)
747Reading 1024 bytes from file, expecting 0 bytes ...
748Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
749OK
750int(0)
751bool(false)
752
753-- Reading file content less than max. file size, expeceted : 0 bytes --
754int(0)
755bool(false)
756Reading 1000 bytes from file, expecting 0 bytes ...
757Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
758OK
759int(0)
760bool(false)
761
762-- File opened in mode xb --
763-- Reading entire file content, expeceted : 0 bytes --
764int(0)
765bool(false)
766Reading 1024 bytes from file, expecting 0 bytes ...
767Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
768OK
769int(0)
770bool(false)
771
772-- Reading file content less than max. file size, expeceted : 0 bytes --
773int(0)
774bool(false)
775Reading 1000 bytes from file, expecting 0 bytes ...
776Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
777OK
778int(0)
779bool(false)
780
781-- File opened in mode xt --
782-- Reading entire file content, expeceted : 0 bytes --
783int(0)
784bool(false)
785Reading 1024 bytes from file, expecting 0 bytes ...
786Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
787OK
788int(0)
789bool(false)
790
791-- Reading file content less than max. file size, expeceted : 0 bytes --
792int(0)
793bool(false)
794Reading 1000 bytes from file, expecting 0 bytes ...
795Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
796OK
797int(0)
798bool(false)
799
800Done
801