From 8d4a4f4d97c0275c9275e1934db6ffabbbbcffa5 Mon Sep 17 00:00:00 2001 From: Ricardo Markiewicz Date: Tue, 1 Nov 2005 05:08:12 +0000 Subject: [PATCH] Guardo los nodos por recuperar al salir. --- src/btree.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/btree.cpp b/src/btree.cpp index 0ad4961..e6dea5b 100644 --- a/src/btree.cpp +++ b/src/btree.cpp @@ -46,6 +46,19 @@ BTree::BTree (const std::string &name) BTree::~BTree () { fclose (fp); + + std::string del = filename + ".del"; + + fp = fopen (del.c_str (), "wb"); + std::list::iterator it = deleted_nodes.begin (); + + while (it != deleted_nodes.end ()) { + uint i = *it; + fwrite (&i, 1, sizeof (uint), fp); + it++; + } + + fclose (fp); } void BTree::ReadFileHeader () -- 2.43.0