[Box Backup-dev] COMMIT r804 - box/trunk/bin/bbackupd
boxbackup-dev at fluffy.co.uk
boxbackup-dev at fluffy.co.uk
Sun Aug 20 11:16:47 BST 2006
Author: chris
Date: 2006-08-20 11:16:47 +0100 (Sun, 20 Aug 2006)
New Revision: 804
Modified:
box/trunk/bin/bbackupd/BackupClientDirectoryRecord.cpp
Log:
* bin/bbackupd/BackupClientDirectoryRecord.cpp
- Fixed exclusion of files, and display of path names, when backing up
the root directory of a drive, or the UNIX root.
Modified: box/trunk/bin/bbackupd/BackupClientDirectoryRecord.cpp
===================================================================
--- box/trunk/bin/bbackupd/BackupClientDirectoryRecord.cpp 2006-08-20 10:06:55 UTC (rev 803)
+++ box/trunk/bin/bbackupd/BackupClientDirectoryRecord.cpp 2006-08-20 10:16:47 UTC (rev 804)
@@ -97,6 +97,33 @@
// --------------------------------------------------------------------------
//
// Function
+// Name: MakeFullPath(const std::string& rDir, const std::string& rFile)
+// Purpose: Combine directory and file name
+// Created: 2006/08/10
+//
+// --------------------------------------------------------------------------
+static std::string MakeFullPath(const std::string& rDir,
+ const std::string& rFile)
+{
+ std::string result;
+
+ if (rDir.size() > 0 &&
+ rDir[rDir.size()-1] == DIRECTORY_SEPARATOR_ASCHAR)
+ {
+ result = rDir + rFile;
+ }
+ else
+ {
+ result = rDir + DIRECTORY_SEPARATOR + rFile;
+ }
+
+ return result;
+}
+
+
+// --------------------------------------------------------------------------
+//
+// Function
// Name: BackupClientDirectoryRecord::SyncDirectory(BackupClientDirectoryRecord::SyncParams &, int64_t, const std::string &, bool)
// Purpose: Syncronise, recusively, a local directory with the server.
// Created: 2003/10/08
@@ -207,8 +234,7 @@
}
// Stat file to get info
- filename = rLocalPath + DIRECTORY_SEPARATOR +
- en->d_name;
+ filename = MakeFullPath(rLocalPath, en->d_name);
if(::lstat(filename.c_str(), &st) != 0)
{
@@ -512,7 +538,7 @@
f != rFiles.end(); ++f)
{
// Filename of this file
- std::string filename(rLocalPath + DIRECTORY_SEPARATOR + *f);
+ std::string filename(MakeFullPath(rLocalPath, *f));
// Get relevant info about file
box_time_t modTime = 0;
@@ -818,7 +844,7 @@
d != rDirs.end(); ++d)
{
// Get the local filename
- std::string dirname(rLocalPath + DIRECTORY_SEPARATOR + *d);
+ std::string dirname(MakeFullPath(rLocalPath, *d));
// See if it's in the listing (if we have one)
BackupStoreFilenameClear storeFilename(*d);
@@ -1022,7 +1048,13 @@
BackupClientDirectoryRecord *rec = e->second;
mSubDirectories.erase(e);
delete rec;
- TRACE2("Deleted directory record for %s/%s\n", rLocalPath.c_str(), dirname.GetClearFilename().c_str());
+
+ std::string name = MakeFullPath(
+ rLocalPath,
+ dirname.GetClearFilename());
+
+ TRACE1("Deleted directory record for "
+ "%s\n", name.c_str());
}
}
}
More information about the Boxbackup-dev
mailing list