fread_basic.phpt 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640
  1. --TEST--
  2. Test fread() function : basic functionality
  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. // include the file.inc for common functions for test
  13. include ("file.inc");
  14. /* Function : function check_size(string $data, int $expect_size)
  15. Description : Check the length of the data, and compare the size with $expect_size
  16. $data : Text data.
  17. $expect_size : Expected data length
  18. */
  19. function check_size($data, $expect_size) {
  20. $size=strlen($data);
  21. if ( $size == $expect_size)
  22. echo "OK\n";
  23. else
  24. echo "Error: Expected: $expect_size, Actual: $size";
  25. }
  26. echo "*** Testing fread() basic operations ***\n";
  27. /*
  28. test fread with file opened in "r" and "rb" mode only
  29. Content with numeric and strings with it
  30. */
  31. $file_modes = array( "r", "rb", "rt", "r+", "r+b", "r+t");
  32. $file_content_types = array("numeric","text","text_with_new_line","alphanumeric");
  33. foreach($file_content_types as $file_content_type) {
  34. echo "\n-- Testing fread) with file having data of type ". $file_content_type ." --\n";
  35. /* create files with $file_content_type */
  36. create_files ( dirname(__FILE__), 1, $file_content_type, 0755, 1, "w", "fread_basic");
  37. $filename = dirname(__FILE__)."/fread_basic1.tmp"; // this is name of the file created by create_files()
  38. /* open the file using $files_modes and perform fread() on it */
  39. for($inner_loop_counter = 0;
  40. $inner_loop_counter < count($file_modes);
  41. $inner_loop_counter++) {
  42. echo "-- File opened in mode ".$file_modes[$inner_loop_counter]." --\n";
  43. $file_handle = fopen($filename, $file_modes[$inner_loop_counter]);
  44. if (!$file_handle) {
  45. echo "Error: failed to fopen() file: $filename!";
  46. exit();
  47. }
  48. /* read file by giving the acutal length, check the length and content by calculating the
  49. hash using md5() function
  50. */
  51. /* Reading 1024 bytes from file, expecting 1024 bytes */ ;
  52. var_dump(ftell($file_handle));
  53. var_dump( feof($file_handle) );
  54. echo "Reading 1024 bytes from file, expecting 1024 bytes ... ";
  55. $data_from_file=fread($file_handle, 1024);
  56. check_size($data_from_file,1024);
  57. var_dump(ftell($file_handle));
  58. var_dump( feof($file_handle) );
  59. var_dump( md5($data_from_file) ); // calculate the hash and dump it
  60. /* read file by giving size more than its size */
  61. var_dump(rewind($file_handle));
  62. var_dump(ftell($file_handle));
  63. var_dump( feof($file_handle) );
  64. /*reading 1030 bytes from file, expecting 1024 bytes */ ;
  65. echo "Reading 1030 bytes from file, expecting 1024 bytes ... ";
  66. $data_from_file=fread($file_handle, 1030);// request for 6 bytes more than its size
  67. check_size($data_from_file,1024);
  68. var_dump(ftell($file_handle));
  69. var_dump( feof($file_handle) );
  70. var_dump( md5($data_from_file) ); // calculate the hash and dump it
  71. // reading 1000 bytes within the file max size
  72. var_dump(rewind($file_handle));
  73. var_dump(ftell($file_handle));
  74. var_dump( feof($file_handle) );
  75. /*reading 1000 bytes from file, expecting 1000 bytes */ ;
  76. echo "Reading 1000 bytes from file, expecting 1000 bytes ... ";
  77. $data_from_file=fread($file_handle, 1000);// request for 24 bytes less than its size
  78. check_size($data_from_file,1000);
  79. var_dump(ftell($file_handle));
  80. var_dump( feof($file_handle) );
  81. var_dump( md5($data_from_file) ); // calculate the hash and dump it
  82. var_dump(fclose($file_handle)); // now close the file
  83. } // end of inner for loop
  84. // delete the file created
  85. delete_file($filename); // delete file with name
  86. } // end of outer foreach loop
  87. echo "Done\n";
  88. ?>
  89. --EXPECTF--
  90. *** Testing fread() basic operations ***
  91. -- Testing fread) with file having data of type numeric --
  92. -- File opened in mode r --
  93. int(0)
  94. bool(false)
  95. Reading 1024 bytes from file, expecting 1024 bytes ... OK
  96. int(1024)
  97. bool(false)
  98. string(32) "950b7457d1deb6332f2fc5d42f3129d6"
  99. bool(true)
  100. int(0)
  101. bool(false)
  102. Reading 1030 bytes from file, expecting 1024 bytes ... OK
  103. int(1024)
  104. bool(true)
  105. string(32) "950b7457d1deb6332f2fc5d42f3129d6"
  106. bool(true)
  107. int(0)
  108. bool(false)
  109. Reading 1000 bytes from file, expecting 1000 bytes ... OK
  110. int(1000)
  111. bool(false)
  112. string(32) "4501f99f2b79d0345f26f1394aca58a3"
  113. bool(true)
  114. -- File opened in mode rb --
  115. int(0)
  116. bool(false)
  117. Reading 1024 bytes from file, expecting 1024 bytes ... OK
  118. int(1024)
  119. bool(false)
  120. string(32) "950b7457d1deb6332f2fc5d42f3129d6"
  121. bool(true)
  122. int(0)
  123. bool(false)
  124. Reading 1030 bytes from file, expecting 1024 bytes ... OK
  125. int(1024)
  126. bool(true)
  127. string(32) "950b7457d1deb6332f2fc5d42f3129d6"
  128. bool(true)
  129. int(0)
  130. bool(false)
  131. Reading 1000 bytes from file, expecting 1000 bytes ... OK
  132. int(1000)
  133. bool(false)
  134. string(32) "4501f99f2b79d0345f26f1394aca58a3"
  135. bool(true)
  136. -- File opened in mode rt --
  137. int(0)
  138. bool(false)
  139. Reading 1024 bytes from file, expecting 1024 bytes ... OK
  140. int(1024)
  141. bool(false)
  142. string(32) "950b7457d1deb6332f2fc5d42f3129d6"
  143. bool(true)
  144. int(0)
  145. bool(false)
  146. Reading 1030 bytes from file, expecting 1024 bytes ... OK
  147. int(1024)
  148. bool(true)
  149. string(32) "950b7457d1deb6332f2fc5d42f3129d6"
  150. bool(true)
  151. int(0)
  152. bool(false)
  153. Reading 1000 bytes from file, expecting 1000 bytes ... OK
  154. int(1000)
  155. bool(false)
  156. string(32) "4501f99f2b79d0345f26f1394aca58a3"
  157. bool(true)
  158. -- File opened in mode r+ --
  159. int(0)
  160. bool(false)
  161. Reading 1024 bytes from file, expecting 1024 bytes ... OK
  162. int(1024)
  163. bool(false)
  164. string(32) "950b7457d1deb6332f2fc5d42f3129d6"
  165. bool(true)
  166. int(0)
  167. bool(false)
  168. Reading 1030 bytes from file, expecting 1024 bytes ... OK
  169. int(1024)
  170. bool(true)
  171. string(32) "950b7457d1deb6332f2fc5d42f3129d6"
  172. bool(true)
  173. int(0)
  174. bool(false)
  175. Reading 1000 bytes from file, expecting 1000 bytes ... OK
  176. int(1000)
  177. bool(false)
  178. string(32) "4501f99f2b79d0345f26f1394aca58a3"
  179. bool(true)
  180. -- File opened in mode r+b --
  181. int(0)
  182. bool(false)
  183. Reading 1024 bytes from file, expecting 1024 bytes ... OK
  184. int(1024)
  185. bool(false)
  186. string(32) "950b7457d1deb6332f2fc5d42f3129d6"
  187. bool(true)
  188. int(0)
  189. bool(false)
  190. Reading 1030 bytes from file, expecting 1024 bytes ... OK
  191. int(1024)
  192. bool(true)
  193. string(32) "950b7457d1deb6332f2fc5d42f3129d6"
  194. bool(true)
  195. int(0)
  196. bool(false)
  197. Reading 1000 bytes from file, expecting 1000 bytes ... OK
  198. int(1000)
  199. bool(false)
  200. string(32) "4501f99f2b79d0345f26f1394aca58a3"
  201. bool(true)
  202. -- File opened in mode r+t --
  203. int(0)
  204. bool(false)
  205. Reading 1024 bytes from file, expecting 1024 bytes ... OK
  206. int(1024)
  207. bool(false)
  208. string(32) "950b7457d1deb6332f2fc5d42f3129d6"
  209. bool(true)
  210. int(0)
  211. bool(false)
  212. Reading 1030 bytes from file, expecting 1024 bytes ... OK
  213. int(1024)
  214. bool(true)
  215. string(32) "950b7457d1deb6332f2fc5d42f3129d6"
  216. bool(true)
  217. int(0)
  218. bool(false)
  219. Reading 1000 bytes from file, expecting 1000 bytes ... OK
  220. int(1000)
  221. bool(false)
  222. string(32) "4501f99f2b79d0345f26f1394aca58a3"
  223. bool(true)
  224. -- Testing fread) with file having data of type text --
  225. -- File opened in mode r --
  226. int(0)
  227. bool(false)
  228. Reading 1024 bytes from file, expecting 1024 bytes ... OK
  229. int(1024)
  230. bool(false)
  231. string(32) "e486000c4c8452774f746a27658d87fa"
  232. bool(true)
  233. int(0)
  234. bool(false)
  235. Reading 1030 bytes from file, expecting 1024 bytes ... OK
  236. int(1024)
  237. bool(true)
  238. string(32) "e486000c4c8452774f746a27658d87fa"
  239. bool(true)
  240. int(0)
  241. bool(false)
  242. Reading 1000 bytes from file, expecting 1000 bytes ... OK
  243. int(1000)
  244. bool(false)
  245. string(32) "2ec76a59f8c44b8f8a0f5139f61bb1bd"
  246. bool(true)
  247. -- File opened in mode rb --
  248. int(0)
  249. bool(false)
  250. Reading 1024 bytes from file, expecting 1024 bytes ... OK
  251. int(1024)
  252. bool(false)
  253. string(32) "e486000c4c8452774f746a27658d87fa"
  254. bool(true)
  255. int(0)
  256. bool(false)
  257. Reading 1030 bytes from file, expecting 1024 bytes ... OK
  258. int(1024)
  259. bool(true)
  260. string(32) "e486000c4c8452774f746a27658d87fa"
  261. bool(true)
  262. int(0)
  263. bool(false)
  264. Reading 1000 bytes from file, expecting 1000 bytes ... OK
  265. int(1000)
  266. bool(false)
  267. string(32) "2ec76a59f8c44b8f8a0f5139f61bb1bd"
  268. bool(true)
  269. -- File opened in mode rt --
  270. int(0)
  271. bool(false)
  272. Reading 1024 bytes from file, expecting 1024 bytes ... OK
  273. int(1024)
  274. bool(false)
  275. string(32) "e486000c4c8452774f746a27658d87fa"
  276. bool(true)
  277. int(0)
  278. bool(false)
  279. Reading 1030 bytes from file, expecting 1024 bytes ... OK
  280. int(1024)
  281. bool(true)
  282. string(32) "e486000c4c8452774f746a27658d87fa"
  283. bool(true)
  284. int(0)
  285. bool(false)
  286. Reading 1000 bytes from file, expecting 1000 bytes ... OK
  287. int(1000)
  288. bool(false)
  289. string(32) "2ec76a59f8c44b8f8a0f5139f61bb1bd"
  290. bool(true)
  291. -- File opened in mode r+ --
  292. int(0)
  293. bool(false)
  294. Reading 1024 bytes from file, expecting 1024 bytes ... OK
  295. int(1024)
  296. bool(false)
  297. string(32) "e486000c4c8452774f746a27658d87fa"
  298. bool(true)
  299. int(0)
  300. bool(false)
  301. Reading 1030 bytes from file, expecting 1024 bytes ... OK
  302. int(1024)
  303. bool(true)
  304. string(32) "e486000c4c8452774f746a27658d87fa"
  305. bool(true)
  306. int(0)
  307. bool(false)
  308. Reading 1000 bytes from file, expecting 1000 bytes ... OK
  309. int(1000)
  310. bool(false)
  311. string(32) "2ec76a59f8c44b8f8a0f5139f61bb1bd"
  312. bool(true)
  313. -- File opened in mode r+b --
  314. int(0)
  315. bool(false)
  316. Reading 1024 bytes from file, expecting 1024 bytes ... OK
  317. int(1024)
  318. bool(false)
  319. string(32) "e486000c4c8452774f746a27658d87fa"
  320. bool(true)
  321. int(0)
  322. bool(false)
  323. Reading 1030 bytes from file, expecting 1024 bytes ... OK
  324. int(1024)
  325. bool(true)
  326. string(32) "e486000c4c8452774f746a27658d87fa"
  327. bool(true)
  328. int(0)
  329. bool(false)
  330. Reading 1000 bytes from file, expecting 1000 bytes ... OK
  331. int(1000)
  332. bool(false)
  333. string(32) "2ec76a59f8c44b8f8a0f5139f61bb1bd"
  334. bool(true)
  335. -- File opened in mode r+t --
  336. int(0)
  337. bool(false)
  338. Reading 1024 bytes from file, expecting 1024 bytes ... OK
  339. int(1024)
  340. bool(false)
  341. string(32) "e486000c4c8452774f746a27658d87fa"
  342. bool(true)
  343. int(0)
  344. bool(false)
  345. Reading 1030 bytes from file, expecting 1024 bytes ... OK
  346. int(1024)
  347. bool(true)
  348. string(32) "e486000c4c8452774f746a27658d87fa"
  349. bool(true)
  350. int(0)
  351. bool(false)
  352. Reading 1000 bytes from file, expecting 1000 bytes ... OK
  353. int(1000)
  354. bool(false)
  355. string(32) "2ec76a59f8c44b8f8a0f5139f61bb1bd"
  356. bool(true)
  357. -- Testing fread) with file having data of type text_with_new_line --
  358. -- File opened in mode r --
  359. int(0)
  360. bool(false)
  361. Reading 1024 bytes from file, expecting 1024 bytes ... OK
  362. int(1024)
  363. bool(false)
  364. string(32) "b09c8026a64a88d36d4c2f17983964bb"
  365. bool(true)
  366. int(0)
  367. bool(false)
  368. Reading 1030 bytes from file, expecting 1024 bytes ... OK
  369. int(1024)
  370. bool(true)
  371. string(32) "b09c8026a64a88d36d4c2f17983964bb"
  372. bool(true)
  373. int(0)
  374. bool(false)
  375. Reading 1000 bytes from file, expecting 1000 bytes ... OK
  376. int(1000)
  377. bool(false)
  378. string(32) "a148fa8110bbac875d84fc9d7056c0a1"
  379. bool(true)
  380. -- File opened in mode rb --
  381. int(0)
  382. bool(false)
  383. Reading 1024 bytes from file, expecting 1024 bytes ... OK
  384. int(1024)
  385. bool(false)
  386. string(32) "b09c8026a64a88d36d4c2f17983964bb"
  387. bool(true)
  388. int(0)
  389. bool(false)
  390. Reading 1030 bytes from file, expecting 1024 bytes ... OK
  391. int(1024)
  392. bool(true)
  393. string(32) "b09c8026a64a88d36d4c2f17983964bb"
  394. bool(true)
  395. int(0)
  396. bool(false)
  397. Reading 1000 bytes from file, expecting 1000 bytes ... OK
  398. int(1000)
  399. bool(false)
  400. string(32) "a148fa8110bbac875d84fc9d7056c0a1"
  401. bool(true)
  402. -- File opened in mode rt --
  403. int(0)
  404. bool(false)
  405. Reading 1024 bytes from file, expecting 1024 bytes ... OK
  406. int(1024)
  407. bool(false)
  408. string(32) "b09c8026a64a88d36d4c2f17983964bb"
  409. bool(true)
  410. int(0)
  411. bool(false)
  412. Reading 1030 bytes from file, expecting 1024 bytes ... OK
  413. int(1024)
  414. bool(true)
  415. string(32) "b09c8026a64a88d36d4c2f17983964bb"
  416. bool(true)
  417. int(0)
  418. bool(false)
  419. Reading 1000 bytes from file, expecting 1000 bytes ... OK
  420. int(1000)
  421. bool(false)
  422. string(32) "a148fa8110bbac875d84fc9d7056c0a1"
  423. bool(true)
  424. -- File opened in mode r+ --
  425. int(0)
  426. bool(false)
  427. Reading 1024 bytes from file, expecting 1024 bytes ... OK
  428. int(1024)
  429. bool(false)
  430. string(32) "b09c8026a64a88d36d4c2f17983964bb"
  431. bool(true)
  432. int(0)
  433. bool(false)
  434. Reading 1030 bytes from file, expecting 1024 bytes ... OK
  435. int(1024)
  436. bool(true)
  437. string(32) "b09c8026a64a88d36d4c2f17983964bb"
  438. bool(true)
  439. int(0)
  440. bool(false)
  441. Reading 1000 bytes from file, expecting 1000 bytes ... OK
  442. int(1000)
  443. bool(false)
  444. string(32) "a148fa8110bbac875d84fc9d7056c0a1"
  445. bool(true)
  446. -- File opened in mode r+b --
  447. int(0)
  448. bool(false)
  449. Reading 1024 bytes from file, expecting 1024 bytes ... OK
  450. int(1024)
  451. bool(false)
  452. string(32) "b09c8026a64a88d36d4c2f17983964bb"
  453. bool(true)
  454. int(0)
  455. bool(false)
  456. Reading 1030 bytes from file, expecting 1024 bytes ... OK
  457. int(1024)
  458. bool(true)
  459. string(32) "b09c8026a64a88d36d4c2f17983964bb"
  460. bool(true)
  461. int(0)
  462. bool(false)
  463. Reading 1000 bytes from file, expecting 1000 bytes ... OK
  464. int(1000)
  465. bool(false)
  466. string(32) "a148fa8110bbac875d84fc9d7056c0a1"
  467. bool(true)
  468. -- File opened in mode r+t --
  469. int(0)
  470. bool(false)
  471. Reading 1024 bytes from file, expecting 1024 bytes ... OK
  472. int(1024)
  473. bool(false)
  474. string(32) "b09c8026a64a88d36d4c2f17983964bb"
  475. bool(true)
  476. int(0)
  477. bool(false)
  478. Reading 1030 bytes from file, expecting 1024 bytes ... OK
  479. int(1024)
  480. bool(true)
  481. string(32) "b09c8026a64a88d36d4c2f17983964bb"
  482. bool(true)
  483. int(0)
  484. bool(false)
  485. Reading 1000 bytes from file, expecting 1000 bytes ... OK
  486. int(1000)
  487. bool(false)
  488. string(32) "a148fa8110bbac875d84fc9d7056c0a1"
  489. bool(true)
  490. -- Testing fread) with file having data of type alphanumeric --
  491. -- File opened in mode r --
  492. int(0)
  493. bool(false)
  494. Reading 1024 bytes from file, expecting 1024 bytes ... OK
  495. int(1024)
  496. bool(false)
  497. string(32) "3fabd48d8eaa65c14e0d93d6880c560c"
  498. bool(true)
  499. int(0)
  500. bool(false)
  501. Reading 1030 bytes from file, expecting 1024 bytes ... OK
  502. int(1024)
  503. bool(true)
  504. string(32) "3fabd48d8eaa65c14e0d93d6880c560c"
  505. bool(true)
  506. int(0)
  507. bool(false)
  508. Reading 1000 bytes from file, expecting 1000 bytes ... OK
  509. int(1000)
  510. bool(false)
  511. string(32) "a49d752f980184c7f44568e930f89c72"
  512. bool(true)
  513. -- File opened in mode rb --
  514. int(0)
  515. bool(false)
  516. Reading 1024 bytes from file, expecting 1024 bytes ... OK
  517. int(1024)
  518. bool(false)
  519. string(32) "3fabd48d8eaa65c14e0d93d6880c560c"
  520. bool(true)
  521. int(0)
  522. bool(false)
  523. Reading 1030 bytes from file, expecting 1024 bytes ... OK
  524. int(1024)
  525. bool(true)
  526. string(32) "3fabd48d8eaa65c14e0d93d6880c560c"
  527. bool(true)
  528. int(0)
  529. bool(false)
  530. Reading 1000 bytes from file, expecting 1000 bytes ... OK
  531. int(1000)
  532. bool(false)
  533. string(32) "a49d752f980184c7f44568e930f89c72"
  534. bool(true)
  535. -- File opened in mode rt --
  536. int(0)
  537. bool(false)
  538. Reading 1024 bytes from file, expecting 1024 bytes ... OK
  539. int(1024)
  540. bool(false)
  541. string(32) "3fabd48d8eaa65c14e0d93d6880c560c"
  542. bool(true)
  543. int(0)
  544. bool(false)
  545. Reading 1030 bytes from file, expecting 1024 bytes ... OK
  546. int(1024)
  547. bool(true)
  548. string(32) "3fabd48d8eaa65c14e0d93d6880c560c"
  549. bool(true)
  550. int(0)
  551. bool(false)
  552. Reading 1000 bytes from file, expecting 1000 bytes ... OK
  553. int(1000)
  554. bool(false)
  555. string(32) "a49d752f980184c7f44568e930f89c72"
  556. bool(true)
  557. -- File opened in mode r+ --
  558. int(0)
  559. bool(false)
  560. Reading 1024 bytes from file, expecting 1024 bytes ... OK
  561. int(1024)
  562. bool(false)
  563. string(32) "3fabd48d8eaa65c14e0d93d6880c560c"
  564. bool(true)
  565. int(0)
  566. bool(false)
  567. Reading 1030 bytes from file, expecting 1024 bytes ... OK
  568. int(1024)
  569. bool(true)
  570. string(32) "3fabd48d8eaa65c14e0d93d6880c560c"
  571. bool(true)
  572. int(0)
  573. bool(false)
  574. Reading 1000 bytes from file, expecting 1000 bytes ... OK
  575. int(1000)
  576. bool(false)
  577. string(32) "a49d752f980184c7f44568e930f89c72"
  578. bool(true)
  579. -- File opened in mode r+b --
  580. int(0)
  581. bool(false)
  582. Reading 1024 bytes from file, expecting 1024 bytes ... OK
  583. int(1024)
  584. bool(false)
  585. string(32) "3fabd48d8eaa65c14e0d93d6880c560c"
  586. bool(true)
  587. int(0)
  588. bool(false)
  589. Reading 1030 bytes from file, expecting 1024 bytes ... OK
  590. int(1024)
  591. bool(true)
  592. string(32) "3fabd48d8eaa65c14e0d93d6880c560c"
  593. bool(true)
  594. int(0)
  595. bool(false)
  596. Reading 1000 bytes from file, expecting 1000 bytes ... OK
  597. int(1000)
  598. bool(false)
  599. string(32) "a49d752f980184c7f44568e930f89c72"
  600. bool(true)
  601. -- File opened in mode r+t --
  602. int(0)
  603. bool(false)
  604. Reading 1024 bytes from file, expecting 1024 bytes ... OK
  605. int(1024)
  606. bool(false)
  607. string(32) "3fabd48d8eaa65c14e0d93d6880c560c"
  608. bool(true)
  609. int(0)
  610. bool(false)
  611. Reading 1030 bytes from file, expecting 1024 bytes ... OK
  612. int(1024)
  613. bool(true)
  614. string(32) "3fabd48d8eaa65c14e0d93d6880c560c"
  615. bool(true)
  616. int(0)
  617. bool(false)
  618. Reading 1000 bytes from file, expecting 1000 bytes ... OK
  619. int(1000)
  620. bool(false)
  621. string(32) "a49d752f980184c7f44568e930f89c72"
  622. bool(true)
  623. Done