using namespace std;
static const unsigned int bytes_in_block = 0x800;
-static const char * dbname = "/var/tmp/backups.db";
+static const char * dbname = "/var/lib/backups/backups.db";
unsigned long long current_time() {
unsigned long long rc = 0;
}
}
+template<class I, class O>
+void copy_filenames( I begin, const I &end, O out ) {
+ while( begin != end ) {
+ string output = (*begin)->getFileName();
+ output.push_back( 0 );
+ *out = output;
+ ++out;
+ ++begin;
+ }
+}
+
int main() {
// Parse the list of current files on stdin
file_set current;
copy( current.begin(), current.end(), ostream_iterator<FileData*>( dbout, "" ) );
// Write the 'final' list to stdout
- copy( final.begin(), final.end(), ostream_iterator<FileData*>( cout, "" ) );
+ copy_filenames( final.begin(), final.end(), ostream_iterator<string>( cout, "" ) );
cerr << "Need backing up..." << endl;
cerr << " Added Bytes: " << added_bytes << endl;