in reply to Re: Test binary equality?
in thread Test binary equality?
I know that they are not equal though, here are the first 1024 bytes:my @SB; my $Temp; sysopen(DEV, $Device, O_RDWR | O_SYNC) || die("Error: $!\n"); sysseek(DEV,0,0) || die("$!\n"); sysread(DEV,$SB[0],512) || die("1 $!\n"); sysseek(DEV,0,0) || die("$!\n"); sysread(DEV,$SB[1],512) || die("2 $!\n"); sysseek(DEV,-1024,2) || die("$!\n"); sysread(DEV,$SB[2],512) || die("3 $!\n"); sysseek(DEV,-512,2) || die("$!\n"); sysread(DEV,$SB[3],512) || die("4 $!\n"); if (!($SB[0] eq $SB[1])) { my @Pair; warn("Error, First 2 superblocks do not match! Checking third. +.."); foreach my $I (0 .. 1) { @Pair = ($I,2) if ($SB[$I] eq $SB[2]); } if (!((@Pair[0]) && (@Pair[1]))) { warn("Error, First 3 superblocks do not match! Checking fo +urth and final..."); foreach my $I (0 .. 2) { @Pair = ($I,3) if ($SB[$I] eq $SB[3]); } if (!((@Pair[0]) && (@Pair[1]))) { die("All 4 superblock copies are different! This is ma +jior corruption.\n"); } } $SB[0] = $Pair[1]; }
Abydos OEFS # hexdump -C -n 1024 /dev/sdf1 00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |......... +.......| * 00000200 4f 45 46 53 2d 30 30 30 30 2e 30 30 30 30 30 30 |OEFS-0000 +.000000| 00000210 f0 26 3f f0 9d 1f dc 11 93 c2 d9 64 65 f2 e8 c0 |.&?...... +..de...| 00000220 53 74 72 75 01 00 00 00 00 00 00 00 00 00 00 00 |Stru..... +.......| 00000230 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |......... +.......| * 00000400
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Test binary equality?
by ysth (Canon) on Jun 21, 2007 at 03:15 UTC | |
by exodist (Monk) on Jun 21, 2007 at 03:18 UTC | |
|
Re^3: Test binary equality?
by graff (Chancellor) on Jun 21, 2007 at 03:30 UTC | |
by exodist (Monk) on Jun 21, 2007 at 03:50 UTC |