I think its about done
[backups/.git] / main.cc
diff --git a/main.cc b/main.cc
index 50bf7035cea3568d2ee2634907d13acee6ea720d..079252e1ce51d62d24382a8859e33f516f323bfd 100644 (file)
--- a/main.cc
+++ b/main.cc
@@ -91,7 +91,7 @@ int main() {
 
   unsigned long long block_size = 512ULL;
 
-  bool finished = true;
+  bool complete = true;
 
   // Copy files over until full or out of files
   file_vector::reverse_iterator i = backups_bysize.rbegin();
@@ -103,7 +103,8 @@ int main() {
       bytes_available -= blocks;
       final_set.insert( *i );
     } else {
-      finished = false;
+      // We missed a file that should be included so the backup is not complete
+      complete = false;
     }
     ++i;
   }
@@ -143,9 +144,16 @@ int main() {
   }
 
   // Write the 'current' list to the dbfile
+  ofstream dbout( "test.db" );
+  copy( current.begin(), current.end(), ostream_iterator<FileData*>( dbout, "" ) );
+
   // Write the 'final_set' list to stdout
+  copy( final_set.begin(), final_set.end(), ostream_iterator<FileData*>( cout, "" ) );
 
-  // If ! finished then write a flag to /tmp
+  // If ! complete then write a flag to /tmp
+  if( ! complete ) {
+    cerr << "incomplete" << endl;
+  }
 
   // Clean-up
   for( file_set::iterator i = backed_up.begin(); i != backed_up.end(); ++i ) { delete *i; }