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