From 61ad6c12c81dd37c54797f5b507cdb677211f49a Mon Sep 17 00:00:00 2001 From: Ricardo Markiewicz Date: Tue, 1 Nov 2005 05:17:52 +0000 Subject: [PATCH] Recupero de disco los bloques libres. --- src/btree.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/btree.cpp b/src/btree.cpp index e6dea5b..26224a5 100644 --- a/src/btree.cpp +++ b/src/btree.cpp @@ -35,6 +35,20 @@ BTree::BTree (const std::string &name, unsigned int block_size, int tt, int kt, BTree::BTree (const std::string &name) { + /* Leo los bloques recuperables */ + std::string del = filename + ".del"; + + fp = fopen (del.c_str (), "wb"); + if (fp != NULL) { + uint i; + + while (fread (&i, 1, sizeof (uint), fp)) { + deleted_nodes.push_back (i); + } + + fclose (fp); + } + fp = fopen (name.c_str(), "rb+"); if (!fp) { /* TODO : mandar una exception ? */ -- 2.43.0