fread_variation4.phpt 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563
  1. --TEST--
  2. Test fread() function : usage variations - read beyond file size, write only mode
  3. --FILE--
  4. <?php
  5. // include the file.inc for common functions for test
  6. include ("file.inc");
  7. /* Function : function check_read(resource $file_handle, int $read_size, int $expect_size)
  8. Description : Read data from file of size $read_size and verifies that $expected_size no. of
  9. bytes are read.
  10. $file_handle : File Handle
  11. $read_size : No. of bytes to be read.
  12. $expect_size : Expected data length
  13. Returns: returns the data read
  14. */
  15. function check_read($file_handle, $read_size, $expect_size) {
  16. // print file pointer position before read
  17. var_dump( ftell($file_handle) );
  18. var_dump( feof($file_handle) );
  19. // read the data of size $read_size
  20. echo "Reading $read_size bytes from file, expecting $expect_size bytes ... ";
  21. $data_from_file = fread($file_handle, $read_size);
  22. // check if data read is of expected size
  23. if ( strlen($data_from_file) == $expect_size)
  24. echo "OK\n";
  25. else
  26. echo "Error reading file, total number of bytes read = ".strlen($data_from_file)."\n";
  27. // file pointer position after read
  28. var_dump( ftell($file_handle) );
  29. // check if file pointer at eof()
  30. var_dump( feof($file_handle) );
  31. return $data_from_file;
  32. }
  33. echo "*** Testing fread() : usage variations ***\n";
  34. $file_modes = array("a","ab","at",
  35. "w","wb","wt",
  36. "x","xb","xt" );
  37. $file_content_types = array("numeric","text","text_with_new_line");
  38. foreach($file_content_types as $file_content_type) {
  39. echo "\n-- Testing fread() with file having content of type ". $file_content_type ." --\n";
  40. /* open the file using $files_modes and perform fread() on it */
  41. foreach($file_modes as $file_mode) {
  42. if(!strstr($file_mode,"x")){
  43. /* create files with $file_content_type */
  44. create_files ( __DIR__, 1, $file_content_type, 0755, 1, "w", "fread_variation", 4);
  45. }
  46. $filename = __DIR__."/fread_variation4.tmp"; // this is name of the file created by create_files()
  47. echo "-- File opened in mode ".$file_mode." --\n";
  48. $file_handle = fopen($filename, $file_mode);
  49. if (!$file_handle) {
  50. echo "Error: failed to fopen() file: $filename!";
  51. exit();
  52. }
  53. if(strstr($file_mode,"w") || strstr($file_mode,"x") ) {
  54. fill_file($file_handle, $file_content_type, 1024);
  55. }
  56. rewind($file_handle);
  57. echo "-- Reading beyond filesize, expected : 1024 bytes --\n";
  58. // read file by giving size more than its size
  59. rewind($file_handle);
  60. $data_from_file = check_read($file_handle, 1030, ( strstr($file_mode, "+") ? 1024 : 0) );
  61. if ( $data_from_file != false)
  62. var_dump( md5($data_from_file) );
  63. echo "-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes --\n";
  64. rewind($file_handle);
  65. // try fread when file pointer at end
  66. fseek($file_handle, 0, SEEK_END);
  67. //reading file when file pointer at end
  68. $data_from_file = check_read($file_handle, 10, 0);
  69. if ( $data_from_file != false)
  70. var_dump( md5($data_from_file) );
  71. // now close the file
  72. fclose($file_handle);
  73. // delete the file created
  74. delete_file($filename); // delete file
  75. } // end of inner foreach loop
  76. }// end of outer foreach loop
  77. echo"Done\n";
  78. ?>
  79. --EXPECTF--
  80. *** Testing fread() : usage variations ***
  81. -- Testing fread() with file having content of type numeric --
  82. -- File opened in mode a --
  83. -- Reading beyond filesize, expected : 1024 bytes --
  84. int(0)
  85. bool(false)
  86. Reading 1030 bytes from file, expecting 0 bytes ...
  87. Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
  88. OK
  89. int(0)
  90. bool(false)
  91. -- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes --
  92. int(1024)
  93. bool(false)
  94. Reading 10 bytes from file, expecting 0 bytes ...
  95. Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
  96. OK
  97. int(1024)
  98. bool(false)
  99. -- File opened in mode ab --
  100. -- Reading beyond filesize, expected : 1024 bytes --
  101. int(0)
  102. bool(false)
  103. Reading 1030 bytes from file, expecting 0 bytes ...
  104. Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
  105. OK
  106. int(0)
  107. bool(false)
  108. -- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes --
  109. int(1024)
  110. bool(false)
  111. Reading 10 bytes from file, expecting 0 bytes ...
  112. Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
  113. OK
  114. int(1024)
  115. bool(false)
  116. -- File opened in mode at --
  117. -- Reading beyond filesize, expected : 1024 bytes --
  118. int(0)
  119. bool(false)
  120. Reading 1030 bytes from file, expecting 0 bytes ...
  121. Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
  122. OK
  123. int(0)
  124. bool(false)
  125. -- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes --
  126. int(1024)
  127. bool(false)
  128. Reading 10 bytes from file, expecting 0 bytes ...
  129. Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
  130. OK
  131. int(1024)
  132. bool(false)
  133. -- File opened in mode w --
  134. -- Reading beyond filesize, expected : 1024 bytes --
  135. int(0)
  136. bool(false)
  137. Reading 1030 bytes from file, expecting 0 bytes ...
  138. Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
  139. OK
  140. int(0)
  141. bool(false)
  142. -- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes --
  143. int(1024)
  144. bool(false)
  145. Reading 10 bytes from file, expecting 0 bytes ...
  146. Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
  147. OK
  148. int(1024)
  149. bool(false)
  150. -- File opened in mode wb --
  151. -- Reading beyond filesize, expected : 1024 bytes --
  152. int(0)
  153. bool(false)
  154. Reading 1030 bytes from file, expecting 0 bytes ...
  155. Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
  156. OK
  157. int(0)
  158. bool(false)
  159. -- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes --
  160. int(1024)
  161. bool(false)
  162. Reading 10 bytes from file, expecting 0 bytes ...
  163. Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
  164. OK
  165. int(1024)
  166. bool(false)
  167. -- File opened in mode wt --
  168. -- Reading beyond filesize, expected : 1024 bytes --
  169. int(0)
  170. bool(false)
  171. Reading 1030 bytes from file, expecting 0 bytes ...
  172. Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
  173. OK
  174. int(0)
  175. bool(false)
  176. -- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes --
  177. int(1024)
  178. bool(false)
  179. Reading 10 bytes from file, expecting 0 bytes ...
  180. Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
  181. OK
  182. int(1024)
  183. bool(false)
  184. -- File opened in mode x --
  185. -- Reading beyond filesize, expected : 1024 bytes --
  186. int(0)
  187. bool(false)
  188. Reading 1030 bytes from file, expecting 0 bytes ...
  189. Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
  190. OK
  191. int(0)
  192. bool(false)
  193. -- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes --
  194. int(1024)
  195. bool(false)
  196. Reading 10 bytes from file, expecting 0 bytes ...
  197. Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
  198. OK
  199. int(1024)
  200. bool(false)
  201. -- File opened in mode xb --
  202. -- Reading beyond filesize, expected : 1024 bytes --
  203. int(0)
  204. bool(false)
  205. Reading 1030 bytes from file, expecting 0 bytes ...
  206. Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
  207. OK
  208. int(0)
  209. bool(false)
  210. -- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes --
  211. int(1024)
  212. bool(false)
  213. Reading 10 bytes from file, expecting 0 bytes ...
  214. Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
  215. OK
  216. int(1024)
  217. bool(false)
  218. -- File opened in mode xt --
  219. -- Reading beyond filesize, expected : 1024 bytes --
  220. int(0)
  221. bool(false)
  222. Reading 1030 bytes from file, expecting 0 bytes ...
  223. Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
  224. OK
  225. int(0)
  226. bool(false)
  227. -- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes --
  228. int(1024)
  229. bool(false)
  230. Reading 10 bytes from file, expecting 0 bytes ...
  231. Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
  232. OK
  233. int(1024)
  234. bool(false)
  235. -- Testing fread() with file having content of type text --
  236. -- File opened in mode a --
  237. -- Reading beyond filesize, expected : 1024 bytes --
  238. int(0)
  239. bool(false)
  240. Reading 1030 bytes from file, expecting 0 bytes ...
  241. Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
  242. OK
  243. int(0)
  244. bool(false)
  245. -- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes --
  246. int(1024)
  247. bool(false)
  248. Reading 10 bytes from file, expecting 0 bytes ...
  249. Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
  250. OK
  251. int(1024)
  252. bool(false)
  253. -- File opened in mode ab --
  254. -- Reading beyond filesize, expected : 1024 bytes --
  255. int(0)
  256. bool(false)
  257. Reading 1030 bytes from file, expecting 0 bytes ...
  258. Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
  259. OK
  260. int(0)
  261. bool(false)
  262. -- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes --
  263. int(1024)
  264. bool(false)
  265. Reading 10 bytes from file, expecting 0 bytes ...
  266. Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
  267. OK
  268. int(1024)
  269. bool(false)
  270. -- File opened in mode at --
  271. -- Reading beyond filesize, expected : 1024 bytes --
  272. int(0)
  273. bool(false)
  274. Reading 1030 bytes from file, expecting 0 bytes ...
  275. Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
  276. OK
  277. int(0)
  278. bool(false)
  279. -- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes --
  280. int(1024)
  281. bool(false)
  282. Reading 10 bytes from file, expecting 0 bytes ...
  283. Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
  284. OK
  285. int(1024)
  286. bool(false)
  287. -- File opened in mode w --
  288. -- Reading beyond filesize, expected : 1024 bytes --
  289. int(0)
  290. bool(false)
  291. Reading 1030 bytes from file, expecting 0 bytes ...
  292. Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
  293. OK
  294. int(0)
  295. bool(false)
  296. -- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes --
  297. int(1024)
  298. bool(false)
  299. Reading 10 bytes from file, expecting 0 bytes ...
  300. Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
  301. OK
  302. int(1024)
  303. bool(false)
  304. -- File opened in mode wb --
  305. -- Reading beyond filesize, expected : 1024 bytes --
  306. int(0)
  307. bool(false)
  308. Reading 1030 bytes from file, expecting 0 bytes ...
  309. Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
  310. OK
  311. int(0)
  312. bool(false)
  313. -- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes --
  314. int(1024)
  315. bool(false)
  316. Reading 10 bytes from file, expecting 0 bytes ...
  317. Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
  318. OK
  319. int(1024)
  320. bool(false)
  321. -- File opened in mode wt --
  322. -- Reading beyond filesize, expected : 1024 bytes --
  323. int(0)
  324. bool(false)
  325. Reading 1030 bytes from file, expecting 0 bytes ...
  326. Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
  327. OK
  328. int(0)
  329. bool(false)
  330. -- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes --
  331. int(1024)
  332. bool(false)
  333. Reading 10 bytes from file, expecting 0 bytes ...
  334. Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
  335. OK
  336. int(1024)
  337. bool(false)
  338. -- File opened in mode x --
  339. -- Reading beyond filesize, expected : 1024 bytes --
  340. int(0)
  341. bool(false)
  342. Reading 1030 bytes from file, expecting 0 bytes ...
  343. Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
  344. OK
  345. int(0)
  346. bool(false)
  347. -- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes --
  348. int(1024)
  349. bool(false)
  350. Reading 10 bytes from file, expecting 0 bytes ...
  351. Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
  352. OK
  353. int(1024)
  354. bool(false)
  355. -- File opened in mode xb --
  356. -- Reading beyond filesize, expected : 1024 bytes --
  357. int(0)
  358. bool(false)
  359. Reading 1030 bytes from file, expecting 0 bytes ...
  360. Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
  361. OK
  362. int(0)
  363. bool(false)
  364. -- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes --
  365. int(1024)
  366. bool(false)
  367. Reading 10 bytes from file, expecting 0 bytes ...
  368. Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
  369. OK
  370. int(1024)
  371. bool(false)
  372. -- File opened in mode xt --
  373. -- Reading beyond filesize, expected : 1024 bytes --
  374. int(0)
  375. bool(false)
  376. Reading 1030 bytes from file, expecting 0 bytes ...
  377. Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
  378. OK
  379. int(0)
  380. bool(false)
  381. -- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes --
  382. int(1024)
  383. bool(false)
  384. Reading 10 bytes from file, expecting 0 bytes ...
  385. Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
  386. OK
  387. int(1024)
  388. bool(false)
  389. -- Testing fread() with file having content of type text_with_new_line --
  390. -- File opened in mode a --
  391. -- Reading beyond filesize, expected : 1024 bytes --
  392. int(0)
  393. bool(false)
  394. Reading 1030 bytes from file, expecting 0 bytes ...
  395. Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
  396. OK
  397. int(0)
  398. bool(false)
  399. -- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes --
  400. int(1024)
  401. bool(false)
  402. Reading 10 bytes from file, expecting 0 bytes ...
  403. Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
  404. OK
  405. int(1024)
  406. bool(false)
  407. -- File opened in mode ab --
  408. -- Reading beyond filesize, expected : 1024 bytes --
  409. int(0)
  410. bool(false)
  411. Reading 1030 bytes from file, expecting 0 bytes ...
  412. Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
  413. OK
  414. int(0)
  415. bool(false)
  416. -- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes --
  417. int(1024)
  418. bool(false)
  419. Reading 10 bytes from file, expecting 0 bytes ...
  420. Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
  421. OK
  422. int(1024)
  423. bool(false)
  424. -- File opened in mode at --
  425. -- Reading beyond filesize, expected : 1024 bytes --
  426. int(0)
  427. bool(false)
  428. Reading 1030 bytes from file, expecting 0 bytes ...
  429. Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
  430. OK
  431. int(0)
  432. bool(false)
  433. -- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes --
  434. int(1024)
  435. bool(false)
  436. Reading 10 bytes from file, expecting 0 bytes ...
  437. Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
  438. OK
  439. int(1024)
  440. bool(false)
  441. -- File opened in mode w --
  442. -- Reading beyond filesize, expected : 1024 bytes --
  443. int(0)
  444. bool(false)
  445. Reading 1030 bytes from file, expecting 0 bytes ...
  446. Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
  447. OK
  448. int(0)
  449. bool(false)
  450. -- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes --
  451. int(1024)
  452. bool(false)
  453. Reading 10 bytes from file, expecting 0 bytes ...
  454. Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
  455. OK
  456. int(1024)
  457. bool(false)
  458. -- File opened in mode wb --
  459. -- Reading beyond filesize, expected : 1024 bytes --
  460. int(0)
  461. bool(false)
  462. Reading 1030 bytes from file, expecting 0 bytes ...
  463. Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
  464. OK
  465. int(0)
  466. bool(false)
  467. -- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes --
  468. int(1024)
  469. bool(false)
  470. Reading 10 bytes from file, expecting 0 bytes ...
  471. Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
  472. OK
  473. int(1024)
  474. bool(false)
  475. -- File opened in mode wt --
  476. -- Reading beyond filesize, expected : 1024 bytes --
  477. int(0)
  478. bool(false)
  479. Reading 1030 bytes from file, expecting 0 bytes ...
  480. Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
  481. OK
  482. int(0)
  483. bool(false)
  484. -- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes --
  485. int(%r1024|1137%r)
  486. bool(false)
  487. Reading 10 bytes from file, expecting 0 bytes ...
  488. Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
  489. OK
  490. int(%r1024|1137%r)
  491. bool(false)
  492. -- File opened in mode x --
  493. -- Reading beyond filesize, expected : 1024 bytes --
  494. int(0)
  495. bool(false)
  496. Reading 1030 bytes from file, expecting 0 bytes ...
  497. Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
  498. OK
  499. int(0)
  500. bool(false)
  501. -- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes --
  502. int(1024)
  503. bool(false)
  504. Reading 10 bytes from file, expecting 0 bytes ...
  505. Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
  506. OK
  507. int(1024)
  508. bool(false)
  509. -- File opened in mode xb --
  510. -- Reading beyond filesize, expected : 1024 bytes --
  511. int(0)
  512. bool(false)
  513. Reading 1030 bytes from file, expecting 0 bytes ...
  514. Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
  515. OK
  516. int(0)
  517. bool(false)
  518. -- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes --
  519. int(1024)
  520. bool(false)
  521. Reading 10 bytes from file, expecting 0 bytes ...
  522. Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
  523. OK
  524. int(1024)
  525. bool(false)
  526. -- File opened in mode xt --
  527. -- Reading beyond filesize, expected : 1024 bytes --
  528. int(0)
  529. bool(false)
  530. Reading 1030 bytes from file, expecting 0 bytes ...
  531. Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
  532. OK
  533. int(0)
  534. bool(false)
  535. -- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes --
  536. int(%r1024|1137%r)
  537. bool(false)
  538. Reading 10 bytes from file, expecting 0 bytes ...
  539. Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
  540. OK
  541. int(%r1024|1137%r)
  542. bool(false)
  543. Done