Annotation of embedaddon/php/ext/standard/tests/file/fread_variation1.phpt, revision 1.1

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

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>