I'm using Windows98 on my home PC. I have a collection of Video CDs (VCD) of recent movies.

Yesterday I discovered that a CD has been badly scratched near the end.. I tried to watch it to see what happens, near the end of the movie (at the credits) the computer crashes.

I tried to copy it to the hard drive, to burn it on a new CD, but the copy fails at 99% ; Windows fails to copy the last 10 Kb of the file and messages an error, without closing the file...

I had to save the remaining data of the file, so I ran to perl;

#!perl -w open READ, 'f:\mpegav\avseq01.dat'; binmode (READ); open WRITE, ">c:\CD\scream3.dat"; binmode (WRITE); # If the file read fails, the script won't die, the eval # just fails, and I can close the file. :) eval { while (<READ>) { print WRITE $_; print tell (READ) ," bytes\n"; # just to see some action on the sc +reen. } }; close (WRITE); close (READ);

Not very much of a smart code, but it saved my movie...

now what would have happened if the scratch was in the middle of the file???


He who asks will be a fool for five minutes, but he who doesn't ask will remain a fool for life.

Chady | http://chady.net/

Replies are listed 'Best First'.
Non-Perl Solution
by vbrtrmn (Pilgrim) on May 02, 2001 at 23:50 UTC
    Use one of those Skip Doctor things .. www.skipdoctor.com. I read a review of their Game Doctor product about a year ago, it seemed pretty reliable.
    -- paul