Hmm... I've written this quite paranoid little script to test my filesystem,
and it works. The script takes a file with 4096 random bytes as input.
I do not think the filesystem has a built-in compression or something (it's
a normal ext3 filesystem), so the file produced by the script

-rw-r--r--    1 root     bin      4311744512 Jul 18 16:01 bigfile

must really be there. An it's more than 4 GB big. So my filesystem must be
capable of having files more then 4 GB big... I suppose. So why the htdig DB
doesn't want to grow bigger than 2 GB? Maybe it's just the berkeley DB
something that can't handle more than 2 GB or something? Or I didn't compile htdig
with some magic options that allow files bigger than 2 GB? Whatever, perl
obviously does fine with files bigger than 2 GB.

Peter Asemann

#!/usr/bin/perl

use Digest::MD5 qw(md5);

undef $/;
open IN,"</tmp/test/newfile" || die "$!";
$input = <IN> || die "$! ";
close IN || die "$!";

$olddigest="AAAAAAAAAAAAAAAA";

open OUT,">/tmp/test/bigfile" || die "$!";
for ($i=0;$i<1048576;$i++)
{
  $digest=(md5($input) ^ $olddigest);
  $olddigest = $digest;
  print OUT $input || die "$!";
  print OUT $digest || die "$!";
}
close OUT;

$olddigest="AAAAAAAAAAAAAAAA";

open IN,"</tmp/test/bigfile" || die "$!";
for ($i=0;$i<1048576;$i++)
{
  seek IN, $i*4112,0;
  read IN,$test,4096 || die "$!";
  $digest=(md5($input) ^ $olddigest);
  $olddigest=$digest;
  read IN,$testdigest,16 || die "$!";
  if ($digest ne $testdigest) {print "failure!"}
}
print "seeked up to ".($i * 4112)." bytes";


-- 
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
htdig-general mailing list <[EMAIL PROTECTED]>
To unsubscribe, send a message to <[EMAIL PROTECTED]> with a 
subject of unsubscribe
FAQ: http://htdig.sourceforge.net/FAQ.html

Reply via email to