Date: | Tue, 25 Apr 2006 09:20:55 +0300 |
From: | Diomidis Spinellis <dds@aueb.gr> |
Organization: | Athens University of Economics and Business |
User-Agent: | Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.2) Gecko/20060404 SeaMonkey/1.0.1 |
MIME-Version: | 1.0 |
Newsgroups: | comp.lang.perl.misc |
Subject: | Re: ideas to salvage corrupt tie()ed DB_File file? |
References: | <1145937788.192476.284130@t31g2000cwb.googlegroups.com> |
In-Reply-To: | <1145937788.192476.284130@t31g2000cwb.googlegroups.com> |
Content-Type: | text/plain; charset=ISO-8859-1; format=flowed |
Content-Transfer-Encoding: | 7bit |
botfood wrote: > after extensive testing I am stuck with the realization that a database > file salvaged from a corrupted webserver has been messed up just enough > so that tie() fails to open it. I don't know whether it was a virus, a > mechanical crash, or caused by a software bug. using -f and -r checks > pass the file as existing and readable, but the tie() using DB_File > fails and the $! reports 'No such file or directory'. [...] > What I am wondering to the group here is whether it is worth my time to > attempt to extract the pattern of readable text from the file created > as a tie()ed DB_File, save as plain text, and then write another import > tool to write the text back into a tie()ed file. Assuming that your data is tied to a Berkeley DB file, try using the db_dump command that comes with Berkeley DB to dump the data in a readable format. The command's -r and -R options allow you to salvage data from a corrupt database. If the command's documentation is not available on your system, you can find it online at <http://www.sleepycat.com/docs/utility/db_dump.html>. -- Diomidis Spinellis Code Quality: The Open Source Perspective (Addison-Wesley 2006) http://www.spinellis.gr/codequality?clpm