Re: 'file' splits data into 8k chunks

From: Date: Mon, 26 Jun 2000 21:53:01 +0000
Subject: Re: 'file' splits data into 8k chunks
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-22407@lists.php.net to get a copy of this message
I removed this limit. Upgrade to 4.0.1 when it comes out (or update to the CVS). Zeev At 19:53 26/06/2000, chrism wrote:
bugs.php.net is down - this is with php 4.0.0 Chris chrism@four.net twinhead% php -q test.php data size: 17000 # of records.. 3 chunk 1: 8190 bytes. chunk 2: 8190 bytes. chunk 3: 620 bytes. -- begin included file -- <?php /* * 'file' command incorrectly splits records into 8k chunks */ /* generate 1 line data file of approximate length */ function create_data($filename, $limit) {
        $record = "";
        do {
                $record .= "TEXT";
        } while (strlen($record) < $limit);
        echo "data size: " . strlen($record) . "\n";
        $fh = fopen($filename, "w");
        fputs($fh, $record);
        fclose($fh);
} /* load data using 'file' command and display result summary */ function check_file($filename) {
        $farray = file($filename);
        $fsize = count($farray);
        echo "# of records.. " . $fsize . "\n";
        for ($i = 0; $i < $fsize; $i++) {
                echo "chunk " . ($i + 1) . ": " . strlen($farray[$i]) . " bytes.\n";
        }
} create_data("test.txt", 17000); check_file("test.txt"); ?> --end included file -- -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net For additional commands, e-mail: php-dev-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net
-- Zeev Suraski <zeev@zend.com> http://www.zend.com/

« previous php.dev (#22407) next »