I am using a bit of Perl script to try and examine a corrupt RMS file.

The file has a few invalid records in it, where the record length exceeds the
maximum record length in the file header.

Although there are a lot more records in the file than reported, the program
seems to stop at the first corrupt record, but does not report any kind of
error.

I assume the file corruption is causing the program to fail, but surely it
should report some kind of VMS error status?

Any ideas?

Robert.

*****************************************************

$thefile = "GAMSYF:[RAA.DAT]DCLLOG.ROB";
open(INFILE, "$thefile") or die "The file $thefile could not be found.\n";

$LineCount = 0;

while(<INFILE>) {

    $TheLine = $_;  # Save the line's contents

    chomp($TheLine);  # Get rid of the line break

    $LineCount = $LineCount + 1;  # This is the easy part!

    $LineLen = length($TheLine);

    if ($LineLen > 100) {print "Line $LineCount is $LineLen long\n"}; 
    if ($LineCount > 2096657) {print "= $TheLine\n"};
}

print "Number of lines       $LineCount\n";

*****************************************************



***********************************************************************************
The Random House Group Ltd.
Registered address 20 Vauxhall Bridge Road,
London
SW1V 2SA
http://www.randomhouse.co.uk
Telephone +44 (0) 20 7840 8400.
Any opinions expressed in email are those of the individual and not necessarily those 
of the company. This email and any files transmitted with it are confidential and 
solely for the use of the intended recipient or entity to who they are addressed. It 
may contain material protected by attorney-client privilege. If you are not the 
intended recipient, or a person responsible for delivering to the intended recipient, 
be advised that you have received this email in error and that any use is strictly 
prohibited.
Random House Group IT Department helpdesk +44 (0) 1206 255900.
***********************************************************************************

Reply via email to