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???
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Non-Perl Solution
by vbrtrmn (Pilgrim) on May 02, 2001 at 23:50 UTC |