192 |
# NXTMFB* last block allocated to master file |
# NXTMFB* last block allocated to master file |
193 |
# NXTMFP offset to next available position in last block |
# NXTMFP offset to next available position in last block |
194 |
# MFTYPE always 0 for user db file (1 for system) |
# MFTYPE always 0 for user db file (1 for system) |
195 |
seek($self->{'fileMST'},4,0) || carp "can't seek to offset 0 in MST: $!"; |
seek($self->{'fileMST'},4,0) || croak "can't seek to offset 0 in MST: $!"; |
196 |
|
|
197 |
my $buff; |
my $buff; |
198 |
|
|
199 |
read($self->{'fileMST'}, $buff, 4) || carp "can't read NXTMFN from MST: $!"; |
read($self->{'fileMST'}, $buff, 4) || croak "can't read NXTMFN from MST: $!"; |
200 |
$self->{'NXTMFN'}=unpack("V",$buff) || carp "NXTNFN is zero"; |
$self->{'NXTMFN'}=unpack("V",$buff) || croak "NXTNFN is zero"; |
201 |
|
|
202 |
print STDERR Dumper($self),"\n" if ($self->{debug}); |
print STDERR Dumper($self),"\n" if ($self->{debug}); |
203 |
|
|
240 |
|
|
241 |
# Get the index information from $db.CNT |
# Get the index information from $db.CNT |
242 |
|
|
243 |
open(my $fileCNT, $self->{cnt_file}) || carp "can't read '$self->{cnt_file}': $!"; |
open(my $fileCNT, $self->{cnt_file}) || croak "can't read '$self->{cnt_file}': $!"; |
244 |
binmode($fileCNT); |
binmode($fileCNT); |
245 |
|
|
246 |
my $buff; |
my $buff; |
247 |
|
|
248 |
read($fileCNT, $buff, 26) || carp "can't read first table from CNT: $!"; |
read($fileCNT, $buff, 26) || croak "can't read first table from CNT: $!"; |
249 |
$self->unpack_cnt($buff); |
$self->unpack_cnt($buff); |
250 |
|
|
251 |
read($fileCNT, $buff, 26) || carp "can't read second table from CNT: $!"; |
read($fileCNT, $buff, 26) || croak "can't read second table from CNT: $!"; |
252 |
$self->unpack_cnt($buff); |
$self->unpack_cnt($buff); |
253 |
|
|
254 |
close($fileCNT); |
close($fileCNT); |
335 |
|
|
336 |
# read XRFMFB abd XRFMFP |
# read XRFMFB abd XRFMFP |
337 |
read($self->{'fileXRF'}, $buff, 4); |
read($self->{'fileXRF'}, $buff, 4); |
338 |
my $pointer=unpack("V",$buff) || carp "pointer is null"; |
my $pointer=unpack("V",$buff) || croak "pointer is null"; |
339 |
|
|
340 |
# check for logically deleted record |
# check for logically deleted record |
341 |
if ($pointer & 0x80000000) { |
if ($pointer & 0x80000000) { |